diff options
Diffstat (limited to 'tests/feed/FeedBuilderTest.php')
-rw-r--r-- | tests/feed/FeedBuilderTest.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/feed/FeedBuilderTest.php b/tests/feed/FeedBuilderTest.php index fe37d5f2..5dfe73aa 100644 --- a/tests/feed/FeedBuilderTest.php +++ b/tests/feed/FeedBuilderTest.php | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace Shaarli\Feed; | 3 | namespace Shaarli\Feed; |
4 | 4 | ||
5 | use DateTime; | 5 | use DateTime; |
6 | use PHPUnit\Framework\TestCase; | ||
6 | use ReferenceLinkDB; | 7 | use ReferenceLinkDB; |
7 | use Shaarli\Bookmark\Bookmark; | 8 | use Shaarli\Bookmark\Bookmark; |
8 | use Shaarli\Bookmark\BookmarkFileService; | 9 | use Shaarli\Bookmark\BookmarkFileService; |
@@ -16,7 +17,7 @@ use Shaarli\History; | |||
16 | * | 17 | * |
17 | * Unit tests for FeedBuilder. | 18 | * Unit tests for FeedBuilder. |
18 | */ | 19 | */ |
19 | class FeedBuilderTest extends \PHPUnit\Framework\TestCase | 20 | class FeedBuilderTest extends TestCase |
20 | { | 21 | { |
21 | /** | 22 | /** |
22 | * @var string locale Basque (Spain). | 23 | * @var string locale Basque (Spain). |
@@ -44,7 +45,7 @@ class FeedBuilderTest extends \PHPUnit\Framework\TestCase | |||
44 | /** | 45 | /** |
45 | * Called before every test method. | 46 | * Called before every test method. |
46 | */ | 47 | */ |
47 | public static function setUpBeforeClass() | 48 | public static function setUpBeforeClass(): void |
48 | { | 49 | { |
49 | $conf = new ConfigManager('tests/utils/config/configJson'); | 50 | $conf = new ConfigManager('tests/utils/config/configJson'); |
50 | $conf->set('resource.datastore', self::$testDatastore); | 51 | $conf->set('resource.datastore', self::$testDatastore); |
@@ -60,7 +61,7 @@ class FeedBuilderTest extends \PHPUnit\Framework\TestCase | |||
60 | 'SERVER_NAME' => 'host.tld', | 61 | 'SERVER_NAME' => 'host.tld', |
61 | 'SERVER_PORT' => '80', | 62 | 'SERVER_PORT' => '80', |
62 | 'SCRIPT_NAME' => '/index.php', | 63 | 'SCRIPT_NAME' => '/index.php', |
63 | 'REQUEST_URI' => '/index.php?do=feed', | 64 | 'REQUEST_URI' => '/feed/atom', |
64 | ); | 65 | ); |
65 | } | 66 | } |
66 | 67 | ||
@@ -81,7 +82,7 @@ class FeedBuilderTest extends \PHPUnit\Framework\TestCase | |||
81 | $this->assertEquals(self::$RSS_LANGUAGE, $data['language']); | 82 | $this->assertEquals(self::$RSS_LANGUAGE, $data['language']); |
82 | $this->assertRegExp('/Wed, 03 Aug 2016 09:30:33 \+\d{4}/', $data['last_update']); | 83 | $this->assertRegExp('/Wed, 03 Aug 2016 09:30:33 \+\d{4}/', $data['last_update']); |
83 | $this->assertEquals(true, $data['show_dates']); | 84 | $this->assertEquals(true, $data['show_dates']); |
84 | $this->assertEquals('http://host.tld/index.php?do=feed', $data['self_link']); | 85 | $this->assertEquals('http://host.tld/feed/atom', $data['self_link']); |
85 | $this->assertEquals('http://host.tld/', $data['index_url']); | 86 | $this->assertEquals('http://host.tld/', $data['index_url']); |
86 | $this->assertFalse($data['usepermalinks']); | 87 | $this->assertFalse($data['usepermalinks']); |
87 | $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links'])); | 88 | $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links'])); |
@@ -253,7 +254,7 @@ class FeedBuilderTest extends \PHPUnit\Framework\TestCase | |||
253 | 'SERVER_NAME' => 'host.tld', | 254 | 'SERVER_NAME' => 'host.tld', |
254 | 'SERVER_PORT' => '8080', | 255 | 'SERVER_PORT' => '8080', |
255 | 'SCRIPT_NAME' => '/~user/shaarli/index.php', | 256 | 'SCRIPT_NAME' => '/~user/shaarli/index.php', |
256 | 'REQUEST_URI' => '/~user/shaarli/index.php?do=feed', | 257 | 'REQUEST_URI' => '/~user/shaarli/feed/atom', |
257 | ); | 258 | ); |
258 | $feedBuilder = new FeedBuilder( | 259 | $feedBuilder = new FeedBuilder( |
259 | self::$bookmarkService, | 260 | self::$bookmarkService, |
@@ -265,7 +266,7 @@ class FeedBuilderTest extends \PHPUnit\Framework\TestCase | |||
265 | $data = $feedBuilder->buildData(FeedBuilder::$FEED_ATOM, null); | 266 | $data = $feedBuilder->buildData(FeedBuilder::$FEED_ATOM, null); |
266 | 267 | ||
267 | $this->assertEquals( | 268 | $this->assertEquals( |
268 | 'http://host.tld:8080/~user/shaarli/index.php?do=feed', | 269 | 'http://host.tld:8080/~user/shaarli/feed/atom', |
269 | $data['self_link'] | 270 | $data['self_link'] |
270 | ); | 271 | ); |
271 | 272 | ||