Browse Source

Don't fetch from example.com during tests

rpm
J. King 3 years ago
parent
commit
9e29235d87
  1. 44
      tests/cases/ImportExport/TestOPML.php
  2. 2
      tests/docroot/Feed/Caching/200Future.php
  3. 2
      tests/docroot/Feed/Caching/200Multiple.php
  4. 2
      tests/docroot/Feed/Caching/200None.php
  5. 2
      tests/docroot/Feed/Caching/200Past.php
  6. 2
      tests/docroot/Feed/Caching/200PubDateOnly.php
  7. 2
      tests/docroot/Feed/Caching/200UpdateDate.php
  8. 2
      tests/docroot/Feed/Deduplication/Hashes-Dates1.php
  9. 2
      tests/docroot/Feed/Deduplication/Hashes-Dates2.php
  10. 2
      tests/docroot/Feed/Deduplication/Hashes-Dates3.php
  11. 2
      tests/docroot/Feed/Deduplication/Hashes.php
  12. 2
      tests/docroot/Feed/Deduplication/ID-Dates.php
  13. 2
      tests/docroot/Feed/Deduplication/IdenticalHashes.php
  14. 10
      tests/docroot/Feed/Deduplication/Permalink-Dates.php
  15. 2
      tests/docroot/Feed/Discovery/Feed.php
  16. 2
      tests/docroot/Feed/Fetching/TooLarge.php
  17. 2
      tests/docroot/Feed/Matching/1.php
  18. 2
      tests/docroot/Feed/Matching/2.php
  19. 2
      tests/docroot/Feed/Matching/3.php
  20. 2
      tests/docroot/Feed/Matching/4.php
  21. 2
      tests/docroot/Feed/Matching/5.php
  22. 2
      tests/docroot/Feed/NextFetch/1h.php
  23. 2
      tests/docroot/Feed/NextFetch/3-36h.php
  24. 2
      tests/docroot/Feed/NextFetch/30m.php
  25. 2
      tests/docroot/Feed/NextFetch/36h.php
  26. 2
      tests/docroot/Feed/NextFetch/3h.php
  27. 2
      tests/docroot/Feed/NextFetch/Fallback.php
  28. 2
      tests/docroot/Feed/Parsing/Valid.php
  29. 10
      tests/docroot/Feed/Parsing/XEEAttack.php
  30. 10
      tests/docroot/Feed/Parsing/XXEAttack.php
  31. 2
      tests/docroot/Feed/Scraping/Feed.php
  32. 2
      tests/docroot/Import/OPML/BrokenOPML.2.opml
  33. 10
      tests/docroot/Import/OPML/FeedsOnly.opml
  34. 2
      tests/docroot/Import/some-feed.php
  35. 4
      tests/docroot/index.php
  36. 3
      tests/server.php

44
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 {
<outline text="Photography"/>
<outline text="Politics">
<outline text="Local">
<outline type="rss" text="Toronto Star" xmlUrl="http://example.com/2" category="Canada"/>
<outline type="rss" text="Toronto Star" xmlUrl="http://localhost:8000/2" category="Canada"/>
</outline>
<outline text="National">
<outline type="rss" text="CBC News" xmlUrl="http://example.com/4" category="Canada,Politics"/>
<outline type="rss" text="Ottawa Citizen" xmlUrl="http://example.com/5" category="Canada,Politics"/>
<outline type="rss" text="CBC News" xmlUrl="http://localhost:8000/4" category="Canada,Politics"/>
<outline type="rss" text="Ottawa Citizen" xmlUrl="http://localhost:8000/5" category="Canada,Politics"/>
</outline>
</outline>
<outline text="Science">
<outline text="Rocketry">
<outline type="rss" text="NASA JPL" xmlUrl="http://example.com/1" category="Science etc"/>
<outline type="rss" text="NASA JPL" xmlUrl="http://localhost:8000/1" category="Science etc"/>
</outline>
<outline type="rss" text="Ars Technica" xmlUrl="http://example.com/3" category="Science etc"/>
<outline type="rss" text="Ars Technica" xmlUrl="http://localhost:8000/3" category="Science etc"/>
</outline>
<outline type="rss" text="Eurogamer" xmlUrl="http://example.com/6"/>
<outline type="rss" text="Eurogamer" xmlUrl="http://localhost:8000/6"/>
</body>
</opml>
OPML_EXPORT_SERIALIZATION;
@ -69,12 +69,12 @@ OPML_EXPORT_SERIALIZATION;
<opml version="2.0">
<head/>
<body>
<outline type="rss" text="Ars Technica" xmlUrl="http://example.com/3" category="Science etc"/>
<outline type="rss" text="CBC News" xmlUrl="http://example.com/4" category="Canada,Politics"/>
<outline type="rss" text="Eurogamer" xmlUrl="http://example.com/6"/>
<outline type="rss" text="NASA JPL" xmlUrl="http://example.com/1" category="Science etc"/>
<outline type="rss" text="Ottawa Citizen" xmlUrl="http://example.com/5" category="Canada,Politics"/>
<outline type="rss" text="Toronto Star" xmlUrl="http://example.com/2" category="Canada"/>
<outline type="rss" text="Ars Technica" xmlUrl="http://localhost:8000/3" category="Science etc"/>
<outline type="rss" text="CBC News" xmlUrl="http://localhost:8000/4" category="Canada,Politics"/>
<outline type="rss" text="Eurogamer" xmlUrl="http://localhost:8000/6"/>
<outline type="rss" text="NASA JPL" xmlUrl="http://localhost:8000/1" category="Science etc"/>
<outline type="rss" text="Ottawa Citizen" xmlUrl="http://localhost:8000/5" category="Canada,Politics"/>
<outline type="rss" text="Toronto Star" xmlUrl="http://localhost:8000/2" category="Canada"/>
</body>
</opml>
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"]],
], []]],

2
tests/docroot/Feed/Caching/200Future.php

@ -6,7 +6,7 @@
<rss version="2.0">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
</channel>
</rss>

2
tests/docroot/Feed/Caching/200Multiple.php

@ -6,7 +6,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Caching/200None.php

@ -6,7 +6,7 @@
<rss version="2.0">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Caching/200Past.php

@ -6,7 +6,7 @@
<rss version="2.0">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
</channel>
</rss>

2
tests/docroot/Feed/Caching/200PubDateOnly.php

@ -6,7 +6,7 @@
<rss version="2.0">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Caching/200UpdateDate.php

@ -6,7 +6,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/Hashes-Dates1.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/Hashes-Dates2.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/Hashes-Dates3.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/Hashes.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/ID-Dates.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

2
tests/docroot/Feed/Deduplication/IdenticalHashes.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>

10
tests/docroot/Feed/Deduplication/Permalink-Dates.php

@ -4,29 +4,29 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>A basic feed for testing</description>
<item>
<guid>http://example.com/1</guid>
<guid>http://localhost:8000/1</guid>
<description>Sample article 1</description>
<pubDate>Sun, 18 May 1995 15:21:36 GMT</pubDate>
<atom:updated>2002-02-19T15:21:36Z</atom:updated>
</item>
<item>
<guid>http://example.com/1</guid>
<guid>http://localhost:8000/1</guid>
<description>Sample article 2</description>
<pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate> <!-- This is the correct item and date -->
<atom:updated>2002-04-19T15:21:36Z</atom:updated>
</item>
<item>
<guid>http://example.com/1</guid>
<guid>http://localhost:8000/1</guid>
<description>Sample article 3</description>
<pubDate>Sun, 18 May 2000 15:21:36 GMT</pubDate>
<atom:updated>1999-05-19T15:21:36Z</atom:updated>
</item>
<item>
<guid>http://example.com/2</guid>
<guid>http://localhost:8000/2</guid>
<description>Sample article 4</description>
<pubDate>Sun, 18 May 2000 15:21:36 GMT</pubDate>
<atom:updated>1999-05-19T15:21:36Z</atom:updated>

2
tests/docroot/Feed/Discovery/Feed.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Example newsfeed title</description>
</channel>
</rss>

2
tests/docroot/Feed/Fetching/TooLarge.php

@ -9,7 +9,7 @@ return [
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Example newsfeed title</description>
$item
</channel>

2
tests/docroot/Feed/Matching/1.php

@ -4,7 +4,7 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example feed title</title>
<id>urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8</id>
<link rel="alternate" type="text/html" href="http://example.com/"/>
<link rel="alternate" type="text/html" href="http://localhost:8000/"/>
<entry>
<id>urn:uuid:df329114-43df-11e7-9f23-a938604d62f8</id>

2
tests/docroot/Feed/Matching/2.php

@ -4,7 +4,7 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example feed title</title>
<id>urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8</id>
<link rel="alternate" type="text/html" href="http://example.com/"/>
<link rel="alternate" type="text/html" href="http://localhost:8000/"/>
<entry>
<id>urn:uuid:df329114-43df-11e7-9f23-a938604d62f8</id>

2
tests/docroot/Feed/Matching/3.php

@ -4,7 +4,7 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example feed title</title>
<id>urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8</id>
<link rel="alternate" type="text/html" href="http://example.com/"/>
<link rel="alternate" type="text/html" href="http://localhost:8000/"/>
<entry>
<id>urn:uuid:df329114-43df-11e7-9f23-a938604d62f8</id>

2
tests/docroot/Feed/Matching/4.php

@ -4,7 +4,7 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example feed title</title>
<id>urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8</id>
<link rel="alternate" type="text/html" href="http://example.com/"/>
<link rel="alternate" type="text/html" href="http://localhost:8000/"/>
<entry>
<id>urn:uuid:df329114-43df-11e7-9f23-a938604d62f8</id>

2
tests/docroot/Feed/Matching/5.php

@ -4,7 +4,7 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example feed title</title>
<id>urn:uuid:0fd8f6d8-43df-11e7-8511-9b59a0324eb8</id>
<link rel="alternate" type="text/html" href="http://example.com/"/>
<link rel="alternate" type="text/html" href="http://localhost:8000/"/>
<entry>
<id>urn:uuid:3d5f5154-43e1-11e7-ba11-1dcae392a974</id>

2
tests/docroot/Feed/NextFetch/1h.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/NextFetch/3-36h.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/NextFetch/30m.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/NextFetch/36h.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/NextFetch/3h.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/NextFetch/Fallback.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Example title</title>
<link>http://example.com</link>
<link>http://localhost:8000/</link>
<description>Example description</description>
<item>

2
tests/docroot/Feed/Parsing/Valid.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Example newsfeed title</description>
<item>

10
tests/docroot/Feed/Parsing/XEEAttack.php

@ -16,30 +16,30 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Example newsfeed title</description>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier>
<guid>http://example.com/1</guid>
<guid>http://localhost:8000/1</guid>
<atom:id>urn:uuid:4c8dbc84-42eb-11e7-9f61-6f83db96854f</atom:id> <!-- Correct ID -->
</item>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier>
<guid>http://example.com/1</guid> <!-- Correct ID -->
<guid>http://localhost:8000/1</guid> <!-- Correct ID -->
</item>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier> <!-- Correct ID -->
</item>
<item>
<link>http://example.com/2</link>
<link>http://localhost:8000/2</link>
</item>
<item>
<title>Example title</title>
</item>
<item>
<description>Example content</description>
<enclosure url="http://example.com/text" type="text/plain"/>
<enclosure url="http://localhost:8000/text" type="text/plain"/>
</item>
</channel>
</rss>

10
tests/docroot/Feed/Parsing/XXEAttack.php

@ -7,30 +7,30 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>&xxe;</description>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier>
<guid>http://example.com/1</guid>
<guid>http://localhost:8000/1</guid>
<atom:id>urn:uuid:4c8dbc84-42eb-11e7-9f61-6f83db96854f</atom:id> <!-- Correct ID -->
</item>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier>
<guid>http://example.com/1</guid> <!-- Correct ID -->
<guid>http://localhost:8000/1</guid> <!-- Correct ID -->
</item>
<item>
<dc:identifier>urn:uuid:43fb1908-42ec-11e7-b61b-2b118faca2f2</dc:identifier> <!-- Correct ID -->
</item>
<item>
<link>http://example.com/2</link>
<link>http://localhost:8000/2</link>
</item>
<item>
<title>Example title</title>
</item>
<item>
<description>Example content</description>
<enclosure url="http://example.com/text" type="text/plain"/>
<enclosure url="http://localhost:8000/text" type="text/plain"/>
</item>
</channel>
</rss>

2
tests/docroot/Feed/Scraping/Feed.php

@ -4,7 +4,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Test feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Example newsfeed title</description>
<item>

2
tests/docroot/Import/OPML/BrokenOPML.2.opml

@ -1,2 +1,2 @@
<opml/>
<!-- Not body element -->
<!-- No body element -->

10
tests/docroot/Import/OPML/FeedsOnly.opml

@ -1,10 +1,10 @@
<opml>
<body>
<outline type="rss" xmlUrl="http://example.com/1" text="Feed 1"/>
<outline type="rss" xmlUrl="http://example.com/2" text=""/>
<outline type="rss" xmlUrl="http://example.com/3"/>
<outline type="rss" xmlUrl="http://example.com/4" title="Feed 4"> <!-- Only the "text" attribute is used -->
<outline type="rss" xmlUrl="http://example.com/!" title="Not a feed"/> <!-- Any descendants of a feed are skipped -->
<outline type="rss" xmlUrl="http://localhost:8000/1" text="Feed 1"/>
<outline type="rss" xmlUrl="http://localhost:8000/2" text=""/>
<outline type="rss" xmlUrl="http://localhost:8000/3"/>
<outline type="rss" xmlUrl="http://localhost:8000/4" title="Feed 4"> <!-- Only the "text" attribute is used -->
<outline type="rss" xmlUrl="http://localhost:8000/!" title="Not a feed"/> <!-- Any descendants of a feed are skipped -->
</outline>
<outline type="rss" xmlUrl="" category="whee"/>
<outline type="rss" category="whee,whoo,"/>

2
tests/docroot/Import/some-feed.php

@ -4,7 +4,7 @@
<rss version="2.0">
<channel>
<title>Some feed</title>
<link>http://example.com/</link>
<link>http://localhost:8000/</link>
<description>Just a generic feed</description>
<item>

4
tests/docroot/index.php

@ -0,0 +1,4 @@
<?php return [
'code' => 204,
'content' => "",
];

3
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)) {

Loading…
Cancel
Save