From a5a9cf23acd1248585173aa32757d9720b5f2d62 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 14:41:40 +0200 Subject: Compatibility with PHPUnit 9 --- tests/feed/CachedPageTest.php | 2 +- tests/feed/FeedBuilderTest.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/feed') 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; /** * Unitary tests for cached pages */ -class CachedPageTest extends \PHPUnit\Framework\TestCase +class CachedPageTest extends \Shaarli\TestCase { // test cache directory 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 @@ 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']); } } -- cgit v1.2.3