aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/feed
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-03 14:52:34 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-12 21:39:01 +0200
commitb93cfeba7b5ddb8b20d805017404e73eafd68c95 (patch)
treec99dfd008bc9f5869358b95916831e4f82a62d7f /tests/feed
parent650a5f09cbeb1c1bef19810c6cc504c06d5b7e87 (diff)
downloadShaarli-b93cfeba7b5ddb8b20d805017404e73eafd68c95.tar.gz
Shaarli-b93cfeba7b5ddb8b20d805017404e73eafd68c95.tar.zst
Shaarli-b93cfeba7b5ddb8b20d805017404e73eafd68c95.zip
Fix subfolder configuration in unit tests
Diffstat (limited to 'tests/feed')
-rw-r--r--tests/feed/FeedBuilderTest.php13
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 @@
3namespace Shaarli\Feed; 3namespace Shaarli\Feed;
4 4
5use DateTime; 5use DateTime;
6use PHPUnit\Framework\TestCase;
6use ReferenceLinkDB; 7use ReferenceLinkDB;
7use Shaarli\Bookmark\Bookmark; 8use Shaarli\Bookmark\Bookmark;
8use Shaarli\Bookmark\BookmarkFileService; 9use Shaarli\Bookmark\BookmarkFileService;
@@ -16,7 +17,7 @@ use Shaarli\History;
16 * 17 *
17 * Unit tests for FeedBuilder. 18 * Unit tests for FeedBuilder.
18 */ 19 */
19class FeedBuilderTest extends \PHPUnit\Framework\TestCase 20class 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