diff --git a/tests/cases/ImportExport/TestOPML.php b/tests/cases/ImportExport/TestOPML.php index 3c61688e..469c674b 100644 --- a/tests/cases/ImportExport/TestOPML.php +++ b/tests/cases/ImportExport/TestOPML.php @@ -22,12 +22,12 @@ class TestOPML extends \JKingWeb\Arsse\Test\AbstractTest { ['id' => 1, 'parent' => null, 'children' => 1, 'feeds' => 1, 'name' => "Science"], ]; protected $subscriptions = [ - ['id' => 3, 'folder' => 1, 'top_folder' => 1, 'unread' => 2, 'updated' => "2016-05-23 06:40:02", 'err_msg' => 'argh', 'title' => 'Ars Technica', 'url' => "http://example.com/3", 'favicon' => 'http://example.com/3.png'], - ['id' => 4, 'folder' => 6, 'top_folder' => 3, 'unread' => 6, 'updated' => "2017-10-09 15:58:34", 'err_msg' => '', 'title' => 'CBC News', 'url' => "http://example.com/4", 'favicon' => 'http://example.com/4.png'], - ['id' => 6, 'folder' => null, 'top_folder' => null, 'unread' => 0, 'updated' => "2010-02-12 20:08:47", 'err_msg' => '', 'title' => 'Eurogamer', 'url' => "http://example.com/6", 'favicon' => 'http://example.com/6.png'], - ['id' => 1, 'folder' => 2, 'top_folder' => 1, 'unread' => 5, 'updated' => "2017-09-15 22:54:16", 'err_msg' => '', 'title' => 'NASA JPL', 'url' => "http://example.com/1", 'favicon' => null], - ['id' => 5, 'folder' => 6, 'top_folder' => 3, 'unread' => 12, 'updated' => "2017-07-07 17:07:17", 'err_msg' => '', 'title' => 'Ottawa Citizen', 'url' => "http://example.com/5", 'favicon' => ''], - ['id' => 2, 'folder' => 5, 'top_folder' => 3, 'unread' => 10, 'updated' => "2011-11-11 11:11:11", 'err_msg' => 'oops', 'title' => 'Toronto Star', 'url' => "http://example.com/2", 'favicon' => 'http://example.com/2.png'], + ['id' => 3, 'folder' => 1, 'top_folder' => 1, 'unread' => 2, 'updated' => "2016-05-23 06:40:02", 'err_msg' => 'argh', 'title' => 'Ars Technica', 'url' => "http://localhost:8000/3", 'favicon' => 'http://localhost:8000/3.png'], + ['id' => 4, 'folder' => 6, 'top_folder' => 3, 'unread' => 6, 'updated' => "2017-10-09 15:58:34", 'err_msg' => '', 'title' => 'CBC News', 'url' => "http://localhost:8000/4", 'favicon' => 'http://localhost:8000/4.png'], + ['id' => 6, 'folder' => null, 'top_folder' => null, 'unread' => 0, 'updated' => "2010-02-12 20:08:47", 'err_msg' => '', 'title' => 'Eurogamer', 'url' => "http://localhost:8000/6", 'favicon' => 'http://localhost:8000/6.png'], + ['id' => 1, 'folder' => 2, 'top_folder' => 1, 'unread' => 5, 'updated' => "2017-09-15 22:54:16", 'err_msg' => '', 'title' => 'NASA JPL', 'url' => "http://localhost:8000/1", 'favicon' => null], + ['id' => 5, 'folder' => 6, 'top_folder' => 3, 'unread' => 12, 'updated' => "2017-07-07 17:07:17", 'err_msg' => '', 'title' => 'Ottawa Citizen', 'url' => "http://localhost:8000/5", 'favicon' => ''], + ['id' => 2, 'folder' => 5, 'top_folder' => 3, 'unread' => 10, 'updated' => "2011-11-11 11:11:11", 'err_msg' => 'oops', 'title' => 'Toronto Star', 'url' => "http://localhost:8000/2", 'favicon' => 'http://localhost:8000/2.png'], ]; protected $tags = [ ['id' => 1, 'name' => "Canada", 'subscription' => 2], @@ -47,20 +47,20 @@ class TestOPML extends \JKingWeb\Arsse\Test\AbstractTest { - + - - + + - + - + - + OPML_EXPORT_SERIALIZATION; @@ -69,12 +69,12 @@ OPML_EXPORT_SERIALIZATION; - - - - - - + + + + + + OPML_EXPORT_SERIALIZATION; @@ -129,10 +129,10 @@ OPML_EXPORT_SERIALIZATION; ["Empty.2.opml", false, [[], []]], ["Empty.3.opml", false, [[], []]], ["FeedsOnly.opml", false, [[ - ['url' => "http://example.com/1", 'title' => "Feed 1", 'folder' => 0, 'tags' => []], - ['url' => "http://example.com/2", 'title' => "", 'folder' => 0, 'tags' => []], - ['url' => "http://example.com/3", 'title' => "", 'folder' => 0, 'tags' => []], - ['url' => "http://example.com/4", 'title' => "", 'folder' => 0, 'tags' => []], + ['url' => "http://localhost:8000/1", 'title' => "Feed 1", 'folder' => 0, 'tags' => []], + ['url' => "http://localhost:8000/2", 'title' => "", 'folder' => 0, 'tags' => []], + ['url' => "http://localhost:8000/3", 'title' => "", 'folder' => 0, 'tags' => []], + ['url' => "http://localhost:8000/4", 'title' => "", 'folder' => 0, 'tags' => []], ['url' => "", 'title' => "", 'folder' => 0, 'tags' => ["whee"]], ['url' => "", 'title' => "", 'folder' => 0, 'tags' => ["whee", "whoo"]], ], []]], diff --git a/tests/docroot/Feed/Caching/200Future.php b/tests/docroot/Feed/Caching/200Future.php index ef2ae714..ad43e361 100644 --- a/tests/docroot/Feed/Caching/200Future.php +++ b/tests/docroot/Feed/Caching/200Future.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Caching/200Multiple.php b/tests/docroot/Feed/Caching/200Multiple.php index 583b6633..ebbd8a29 100644 --- a/tests/docroot/Feed/Caching/200Multiple.php +++ b/tests/docroot/Feed/Caching/200Multiple.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Caching/200None.php b/tests/docroot/Feed/Caching/200None.php index 562554cf..ebe7721f 100644 --- a/tests/docroot/Feed/Caching/200None.php +++ b/tests/docroot/Feed/Caching/200None.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Caching/200Past.php b/tests/docroot/Feed/Caching/200Past.php index 361d7670..64da54c5 100644 --- a/tests/docroot/Feed/Caching/200Past.php +++ b/tests/docroot/Feed/Caching/200Past.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Caching/200PubDateOnly.php b/tests/docroot/Feed/Caching/200PubDateOnly.php index 5b8df9b0..93ce6370 100644 --- a/tests/docroot/Feed/Caching/200PubDateOnly.php +++ b/tests/docroot/Feed/Caching/200PubDateOnly.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Caching/200UpdateDate.php b/tests/docroot/Feed/Caching/200UpdateDate.php index e7f9a20b..3315d289 100644 --- a/tests/docroot/Feed/Caching/200UpdateDate.php +++ b/tests/docroot/Feed/Caching/200UpdateDate.php @@ -6,7 +6,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/Hashes-Dates1.php b/tests/docroot/Feed/Deduplication/Hashes-Dates1.php index 4709e807..8449beed 100644 --- a/tests/docroot/Feed/Deduplication/Hashes-Dates1.php +++ b/tests/docroot/Feed/Deduplication/Hashes-Dates1.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/Hashes-Dates2.php b/tests/docroot/Feed/Deduplication/Hashes-Dates2.php index 321d675d..b460c7d8 100644 --- a/tests/docroot/Feed/Deduplication/Hashes-Dates2.php +++ b/tests/docroot/Feed/Deduplication/Hashes-Dates2.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/Hashes-Dates3.php b/tests/docroot/Feed/Deduplication/Hashes-Dates3.php index 01d0916d..ce950194 100644 --- a/tests/docroot/Feed/Deduplication/Hashes-Dates3.php +++ b/tests/docroot/Feed/Deduplication/Hashes-Dates3.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/Hashes.php b/tests/docroot/Feed/Deduplication/Hashes.php index bc6eaec4..2f2a9677 100644 --- a/tests/docroot/Feed/Deduplication/Hashes.php +++ b/tests/docroot/Feed/Deduplication/Hashes.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/ID-Dates.php b/tests/docroot/Feed/Deduplication/ID-Dates.php index f26cfc50..90f70260 100644 --- a/tests/docroot/Feed/Deduplication/ID-Dates.php +++ b/tests/docroot/Feed/Deduplication/ID-Dates.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/IdenticalHashes.php b/tests/docroot/Feed/Deduplication/IdenticalHashes.php index 138b7b44..b9e64667 100644 --- a/tests/docroot/Feed/Deduplication/IdenticalHashes.php +++ b/tests/docroot/Feed/Deduplication/IdenticalHashes.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing diff --git a/tests/docroot/Feed/Deduplication/Permalink-Dates.php b/tests/docroot/Feed/Deduplication/Permalink-Dates.php index 304211a8..afb91548 100644 --- a/tests/docroot/Feed/Deduplication/Permalink-Dates.php +++ b/tests/docroot/Feed/Deduplication/Permalink-Dates.php @@ -4,29 +4,29 @@ Test feed - http://example.com/ + http://localhost:8000/ A basic feed for testing - http://example.com/1 + http://localhost:8000/1 Sample article 1 Sun, 18 May 1995 15:21:36 GMT 2002-02-19T15:21:36Z - http://example.com/1 + http://localhost:8000/1 Sample article 2 Sun, 19 May 2002 15:21:36 GMT 2002-04-19T15:21:36Z - http://example.com/1 + http://localhost:8000/1 Sample article 3 Sun, 18 May 2000 15:21:36 GMT 1999-05-19T15:21:36Z - http://example.com/2 + http://localhost:8000/2 Sample article 4 Sun, 18 May 2000 15:21:36 GMT 1999-05-19T15:21:36Z diff --git a/tests/docroot/Feed/Discovery/Feed.php b/tests/docroot/Feed/Discovery/Feed.php index a13398ac..bb413510 100644 --- a/tests/docroot/Feed/Discovery/Feed.php +++ b/tests/docroot/Feed/Discovery/Feed.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ Example newsfeed title diff --git a/tests/docroot/Feed/Fetching/TooLarge.php b/tests/docroot/Feed/Fetching/TooLarge.php index 0fef567b..d13f89c6 100644 --- a/tests/docroot/Feed/Fetching/TooLarge.php +++ b/tests/docroot/Feed/Fetching/TooLarge.php @@ -9,7 +9,7 @@ return [ Test feed - http://example.com/ + http://localhost:8000/ Example newsfeed title $item diff --git a/tests/docroot/Feed/Matching/1.php b/tests/docroot/Feed/Matching/1.php index fdc2d676..ef9dfcd0 100644 --- a/tests/docroot/Feed/Matching/1.php +++ b/tests/docroot/Feed/Matching/1.php @@ -4,7 +4,7 @@ Example feed title urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8 - + urn:uuid:df329114-43df-11e7-9f23-a938604d62f8 diff --git a/tests/docroot/Feed/Matching/2.php b/tests/docroot/Feed/Matching/2.php index b5e2d51c..0a4ae553 100644 --- a/tests/docroot/Feed/Matching/2.php +++ b/tests/docroot/Feed/Matching/2.php @@ -4,7 +4,7 @@ Example feed title urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8 - + urn:uuid:df329114-43df-11e7-9f23-a938604d62f8 diff --git a/tests/docroot/Feed/Matching/3.php b/tests/docroot/Feed/Matching/3.php index d2c8c0d3..665d5d3a 100644 --- a/tests/docroot/Feed/Matching/3.php +++ b/tests/docroot/Feed/Matching/3.php @@ -4,7 +4,7 @@ Example feed title urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8 - + urn:uuid:df329114-43df-11e7-9f23-a938604d62f8 diff --git a/tests/docroot/Feed/Matching/4.php b/tests/docroot/Feed/Matching/4.php index a68c0e05..5cd92493 100644 --- a/tests/docroot/Feed/Matching/4.php +++ b/tests/docroot/Feed/Matching/4.php @@ -4,7 +4,7 @@ Example feed title urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8 - + urn:uuid:df329114-43df-11e7-9f23-a938604d62f8 diff --git a/tests/docroot/Feed/Matching/5.php b/tests/docroot/Feed/Matching/5.php index efb5a9b3..de61d767 100644 --- a/tests/docroot/Feed/Matching/5.php +++ b/tests/docroot/Feed/Matching/5.php @@ -4,7 +4,7 @@ Example feed title urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8 - + urn:uuid:3d5f5154-43e1-11e7-ba11-1dcae392a974 diff --git a/tests/docroot/Feed/NextFetch/1h.php b/tests/docroot/Feed/NextFetch/1h.php index dd016507..ca9cdac6 100644 --- a/tests/docroot/Feed/NextFetch/1h.php +++ b/tests/docroot/Feed/NextFetch/1h.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/NextFetch/3-36h.php b/tests/docroot/Feed/NextFetch/3-36h.php index 41d799f8..414d2f08 100644 --- a/tests/docroot/Feed/NextFetch/3-36h.php +++ b/tests/docroot/Feed/NextFetch/3-36h.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/NextFetch/30m.php b/tests/docroot/Feed/NextFetch/30m.php index a7dce241..397871ac 100644 --- a/tests/docroot/Feed/NextFetch/30m.php +++ b/tests/docroot/Feed/NextFetch/30m.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/NextFetch/36h.php b/tests/docroot/Feed/NextFetch/36h.php index 359ed9e9..251a456a 100644 --- a/tests/docroot/Feed/NextFetch/36h.php +++ b/tests/docroot/Feed/NextFetch/36h.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/NextFetch/3h.php b/tests/docroot/Feed/NextFetch/3h.php index e2f5758d..dfdd3272 100644 --- a/tests/docroot/Feed/NextFetch/3h.php +++ b/tests/docroot/Feed/NextFetch/3h.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/NextFetch/Fallback.php b/tests/docroot/Feed/NextFetch/Fallback.php index 04cc8ac0..d127c3a3 100644 --- a/tests/docroot/Feed/NextFetch/Fallback.php +++ b/tests/docroot/Feed/NextFetch/Fallback.php @@ -4,7 +4,7 @@ Example title - http://example.com + http://localhost:8000/ Example description diff --git a/tests/docroot/Feed/Parsing/Valid.php b/tests/docroot/Feed/Parsing/Valid.php index f56bd66b..ab953fc9 100644 --- a/tests/docroot/Feed/Parsing/Valid.php +++ b/tests/docroot/Feed/Parsing/Valid.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ Example newsfeed title diff --git a/tests/docroot/Feed/Parsing/XEEAttack.php b/tests/docroot/Feed/Parsing/XEEAttack.php index 12c4cbf7..a4fa7fe7 100644 --- a/tests/docroot/Feed/Parsing/XEEAttack.php +++ b/tests/docroot/Feed/Parsing/XEEAttack.php @@ -16,30 +16,30 @@ Test feed - http://example.com/ + http://localhost:8000/ Example newsfeed title urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/1 + http://localhost:8000/1 urn:uuid:4c8dbc84-42eb-11e7-9f61-6f83db96854f urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/1 + http://localhost:8000/1 urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/2 + http://localhost:8000/2 Example title Example content - + diff --git a/tests/docroot/Feed/Parsing/XXEAttack.php b/tests/docroot/Feed/Parsing/XXEAttack.php index 8a38e142..c1c51487 100644 --- a/tests/docroot/Feed/Parsing/XXEAttack.php +++ b/tests/docroot/Feed/Parsing/XXEAttack.php @@ -7,30 +7,30 @@ Test feed - http://example.com/ + http://localhost:8000/ &xxe; urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/1 + http://localhost:8000/1 urn:uuid:4c8dbc84-42eb-11e7-9f61-6f83db96854f urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/1 + http://localhost:8000/1 urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2 - http://example.com/2 + http://localhost:8000/2 Example title Example content - + diff --git a/tests/docroot/Feed/Scraping/Feed.php b/tests/docroot/Feed/Scraping/Feed.php index 71bf40ec..514dcfd0 100644 --- a/tests/docroot/Feed/Scraping/Feed.php +++ b/tests/docroot/Feed/Scraping/Feed.php @@ -4,7 +4,7 @@ Test feed - http://example.com/ + http://localhost:8000/ Example newsfeed title diff --git a/tests/docroot/Import/OPML/BrokenOPML.2.opml b/tests/docroot/Import/OPML/BrokenOPML.2.opml index ac70153f..691c2bd7 100644 --- a/tests/docroot/Import/OPML/BrokenOPML.2.opml +++ b/tests/docroot/Import/OPML/BrokenOPML.2.opml @@ -1,2 +1,2 @@ - + diff --git a/tests/docroot/Import/OPML/FeedsOnly.opml b/tests/docroot/Import/OPML/FeedsOnly.opml index 4e682600..88fab76d 100644 --- a/tests/docroot/Import/OPML/FeedsOnly.opml +++ b/tests/docroot/Import/OPML/FeedsOnly.opml @@ -1,10 +1,10 @@ - - - - - + + + + + diff --git a/tests/docroot/Import/some-feed.php b/tests/docroot/Import/some-feed.php index eec58567..7f48836f 100644 --- a/tests/docroot/Import/some-feed.php +++ b/tests/docroot/Import/some-feed.php @@ -4,7 +4,7 @@ Some feed - http://example.com/ + http://localhost:8000/ Just a generic feed diff --git a/tests/docroot/index.php b/tests/docroot/index.php new file mode 100644 index 00000000..4a6611e6 --- /dev/null +++ b/tests/docroot/index.php @@ -0,0 +1,4 @@ + 204, + 'content' => "", +]; diff --git a/tests/server.php b/tests/server.php index 2d738c95..2e7d8d47 100644 --- a/tests/server.php +++ b/tests/server.php @@ -41,6 +41,9 @@ $defaults = [ // default values for response ]; $url = explode("?", $_SERVER['REQUEST_URI'])[0]; +if ($url === "/") { + $url = "/index"; +} $base = BASE."tests".\DIRECTORY_SEPARATOR."docroot"; $test = $base.str_replace("/", \DIRECTORY_SEPARATOR, $url).".php"; if (!file_exists($test)) {