X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Ffeed%2FFeedBuilderTest.php;h=c29e8ef3b01753b42f3cb37544cb49c165439a67;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=5dfe73aa49ce9bf047ecc2833ed8bc9375e85c3b;hpb=b93cfeba7b5ddb8b20d805017404e73eafd68c95;p=github%2Fshaarli%2FShaarli.git 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 @@ namespace Shaarli\Feed; use DateTime; -use PHPUnit\Framework\TestCase; use ReferenceLinkDB; use Shaarli\Bookmark\Bookmark; use Shaarli\Bookmark\BookmarkFileService; @@ -11,6 +10,7 @@ use Shaarli\Bookmark\LinkDB; use Shaarli\Config\ConfigManager; use Shaarli\Formatter\FormatterFactory; use Shaarli\History; +use Shaarli\TestCase; /** * FeedBuilderTest class. @@ -97,9 +97,9 @@ class FeedBuilderTest extends TestCase $pub = DateTime::createFromFormat(DateTime::RSS, $link['pub_iso_date']); $up = DateTime::createFromFormat(DateTime::ATOM, $link['up_iso_date']); $this->assertEquals($pub, $up); - $this->assertContains('Stallman has a beard', $link['description']); - $this->assertContains('Permalink', $link['description']); - $this->assertContains('http://host.tld/shaare/WDWyig', $link['description']); + $this->assertContainsPolyfill('Stallman has a beard', $link['description']); + $this->assertContainsPolyfill('Permalink', $link['description']); + $this->assertContainsPolyfill('http://host.tld/shaare/WDWyig', $link['description']); $this->assertEquals(1, count($link['taglist'])); $this->assertEquals('sTuff', $link['taglist'][0]); @@ -201,16 +201,16 @@ class FeedBuilderTest extends TestCase $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114651'), $link['created']); $this->assertEquals('http://host.tld/shaare/WDWyig', $link['guid']); $this->assertEquals('http://host.tld/shaare/WDWyig', $link['url']); - $this->assertContains('Direct link', $link['description']); - $this->assertContains('http://host.tld/shaare/WDWyig', $link['description']); + $this->assertContainsPolyfill('Direct link', $link['description']); + $this->assertContainsPolyfill('http://host.tld/shaare/WDWyig', $link['description']); // Second link is a direct link $link = $data['links'][array_keys($data['links'])[1]]; $this->assertEquals(8, $link['id']); $this->assertEquals(DateTime::createFromFormat(Bookmark::LINK_DATE_FORMAT, '20150310_114633'), $link['created']); $this->assertEquals('http://host.tld/shaare/RttfEw', $link['guid']); $this->assertEquals('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['url']); - $this->assertContains('Direct link', $link['description']); - $this->assertContains('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['description']); + $this->assertContainsPolyfill('Direct link', $link['description']); + $this->assertContainsPolyfill('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['description']); } /** @@ -274,6 +274,6 @@ class FeedBuilderTest extends TestCase $link = $data['links'][array_keys($data['links'])[0]]; $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['guid']); $this->assertEquals('http://host.tld:8080/~user/shaarli/shaare/WDWyig', $link['url']); - $this->assertContains('http://host.tld:8080/~user/shaarli/./add-tag/hashtag', $link['description']); + $this->assertContainsPolyfill('http://host.tld:8080/~user/shaarli/./add-tag/hashtag', $link['description']); } }