diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 14:41:40 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 18:57:20 +0200 |
commit | a5a9cf23acd1248585173aa32757d9720b5f2d62 (patch) | |
tree | 5b443e09fc0f84db0cb478cda0c88c10346b0843 /tests/feed | |
parent | 2b7a7bc928fb7fc171138e248d3aa1d86d5b62f9 (diff) | |
download | Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.gz Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.zst Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.zip |
Compatibility with PHPUnit 9
Diffstat (limited to 'tests/feed')
-rw-r--r-- | tests/feed/CachedPageTest.php | 2 | ||||
-rw-r--r-- | tests/feed/FeedBuilderTest.php | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/feed/CachedPageTest.php b/tests/feed/CachedPageTest.php index 25d640d3..904db9dc 100644 --- a/tests/feed/CachedPageTest.php +++ b/tests/feed/CachedPageTest.php | |||
@@ -7,7 +7,7 @@ namespace Shaarli\Feed; | |||
7 | /** | 7 | /** |
8 | * Unitary tests for cached pages | 8 | * Unitary tests for cached pages |
9 | */ | 9 | */ |
10 | class CachedPageTest extends \PHPUnit\Framework\TestCase | 10 | class CachedPageTest extends \Shaarli\TestCase |
11 | { | 11 | { |
12 | // test cache directory | 12 | // test cache directory |
13 | protected static $testCacheDir = 'sandbox/pagecache'; | 13 | protected static $testCacheDir = 'sandbox/pagecache'; |
diff --git a/tests/feed/FeedBuilderTest.php b/tests/feed/FeedBuilderTest.php index 5dfe73aa..c29e8ef3 100644 --- a/tests/feed/FeedBuilderTest.php +++ b/tests/feed/FeedBuilderTest.php | |||
@@ -3,7 +3,6 @@ | |||
3 | namespace Shaarli\Feed; | 3 | namespace Shaarli\Feed; |
4 | 4 | ||
5 | use DateTime; | 5 | use DateTime; |
6 | use PHPUnit\Framework\TestCase; | ||
7 | use ReferenceLinkDB; | 6 | use ReferenceLinkDB; |
8 | use Shaarli\Bookmark\Bookmark; | 7 | use Shaarli\Bookmark\Bookmark; |
9 | use Shaarli\Bookmark\BookmarkFileService; | 8 | use Shaarli\Bookmark\BookmarkFileService; |
@@ -11,6 +10,7 @@ use Shaarli\Bookmark\LinkDB; | |||
11 | use Shaarli\Config\ConfigManager; | 10 | use Shaarli\Config\ConfigManager; |
12 | use Shaarli\Formatter\FormatterFactory; | 11 | use Shaarli\Formatter\FormatterFactory; |
13 | use Shaarli\History; | 12 | use Shaarli\History; |
13 | use Shaarli\TestCase; | ||
14 | 14 | ||
15 | /** | 15 | /** |
16 | * FeedBuilderTest class. | 16 | * FeedBuilderTest class. |
@@ -97,9 +97,9 @@ class FeedBuilderTest extends TestCase | |||
97 | $pub = DateTime::createFromFormat(DateTime::RSS, $link['pub_iso_date']); | 97 | $pub = DateTime::createFromFormat(DateTime::RSS, $link['pub_iso_date']); |
98 | $up = DateTime::createFromFormat(DateTime::ATOM, $link['up_iso_date']); | 98 | $up = DateTime::createFromFormat(DateTime::ATOM, $link['up_iso_date']); |
99 | $this->assertEquals($pub, $up); | 99 | $this->assertEquals($pub, $up); |
100 | $this->assertContains('Stallman has a beard', $link['description']); | 100 | $this->assertContainsPolyfill('Stallman has a beard', $link['description']); |
101 | $this->assertContains('Permalink', $link['description']); | 101 | $this->assertContainsPolyfill('Permalink', $link['description']); |
102 | $this->assertContains('http://host.tld/shaare/WDWyig', $link['description']); | 102 | $this->assertContainsPolyfill('http://host.tld/shaare/WDWyig', $link['description']); |
103 | $this->assertEquals(1, count($link['taglist'])); | 103 | $this->assertEquals(1, count($link['taglist'])); |
104 | $this->assertEquals('sTuff', $link['taglist'][0]); | 104 | $this->assertEquals('sTuff', $link['taglist'][0]); |
105 | 105 | ||
@@ -201,16 +201,16 @@ class FeedBuilderTest extends TestCase | |||
201 | $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); | 201 | $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); |
202 | $this->assertEquals('http://host.tld/shaare/WDWyig', $link['guid']); | 202 | $this->assertEquals('http://host.tld/shaare/WDWyig', $link['guid']); |
203 | $this->assertEquals('http://host.tld/shaare/WDWyig', $link['url']); | 203 | $this->assertEquals('http://host.tld/shaare/WDWyig', $link['url']); |
204 | $this->assertContains('Direct link', $link['description']); | 204 | $this->assertContainsPolyfill('Direct link', $link['description']); |
205 | $this->assertContains('http://host.tld/shaare/WDWyig', $link['description']); | 205 | $this->assertContainsPolyfill('http://host.tld/shaare/WDWyig', $link['description']); |
206 | // Second link is a direct link | 206 | // Second link is a direct link |
207 | $link = $data['links'][array_keys($data['links'])[1]]; | 207 | $link = $data['links'][array_keys($data['links'])[1]]; |
208 | $this->assertEquals(8, $link['id']); | 208 | $this->assertEquals(8, $link['id']); |
209 | $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114633'), $link['created']); | 209 | $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114633'), $link['created']); |
210 | $this->assertEquals('http://host.tld/shaare/RttfEw', $link['guid']); | 210 | $this->assertEquals('http://host.tld/shaare/RttfEw', $link['guid']); |
211 | $this->assertEquals('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['url']); | 211 | $this->assertEquals('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['url']); |
212 | $this->assertContains('Direct link', $link['description']); | 212 | $this->assertContainsPolyfill('Direct link', $link['description']); |
213 | $this->assertContains('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['description']); | 213 | $this->assertContainsPolyfill('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['description']); |
214 | } | 214 | } |
215 | 215 | ||
216 | /** | 216 | /** |
@@ -274,6 +274,6 @@ class FeedBuilderTest extends TestCase | |||
274 | $link = $data['links'][array_keys($data['links'])[0]]; | 274 | $link = $data['links'][array_keys($data['links'])[0]]; |
275 | $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['guid']); | 275 | $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['guid']); |
276 | $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['url']); | 276 | $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['url']); |
277 | $this->assertContains('http://host.tld:8080/~user/shaarli/./add-tag/hashtag', $link['description']); | 277 | $this->assertContainsPolyfill('http://host.tld:8080/~user/shaarli/./add-tag/hashtag', $link['description']); |
278 | } | 278 | } |
279 | } | 279 | } |