aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/feed
diff options
context:
space:
mode:
Diffstat (limited to 'tests/feed')
-rw-r--r--tests/feed/CachedPageTest.php2
-rw-r--r--tests/feed/FeedBuilderTest.php18
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 */
10class CachedPageTest extends \PHPUnit\Framework\TestCase 10class 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 @@
3namespace Shaarli\Feed; 3namespace Shaarli\Feed;
4 4
5use DateTime; 5use DateTime;
6use PHPUnit\Framework\TestCase;
7use ReferenceLinkDB; 6use ReferenceLinkDB;
8use Shaarli\Bookmark\Bookmark; 7use Shaarli\Bookmark\Bookmark;
9use Shaarli\Bookmark\BookmarkFileService; 8use Shaarli\Bookmark\BookmarkFileService;
@@ -11,6 +10,7 @@ use Shaarli\Bookmark\LinkDB;
11use Shaarli\Config\ConfigManager; 10use Shaarli\Config\ConfigManager;
12use Shaarli\Formatter\FormatterFactory; 11use Shaarli\Formatter\FormatterFactory;
13use Shaarli\History; 12use Shaarli\History;
13use 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}