Browse Source

Mixed content test for OPML

microsub
J. King 5 years ago
parent
commit
be5a1fb94f
  1. 92
      tests/cases/ImportExport/TestOPML.php
  2. 20
      tests/docroot/Import/OPML/MixedContent.opml

92
tests/cases/ImportExport/TestOPML.php

@ -129,75 +129,35 @@ OPML_EXPORT_SERIALIZATION;
["Empty.2.opml", false, [[], []]], ["Empty.2.opml", false, [[], []]],
["Empty.3.opml", false, [[], []]], ["Empty.3.opml", false, [[], []]],
["FeedsOnly.opml", false, [[ ["FeedsOnly.opml", false, [[
[ ['url' => "http://example.com/1", 'title' => "Feed 1", 'folder' => 0, 'tags' => []],
'url' => "http://example.com/1", ['url' => "http://example.com/2", 'title' => "", 'folder' => 0, 'tags' => []],
'title' => "Feed 1", ['url' => "http://example.com/3", 'title' => "", 'folder' => 0, 'tags' => []],
'folder' => 0, ['url' => "http://example.com/4", 'title' => "", 'folder' => 0, 'tags' => []],
'tags' => [], ['url' => "", 'title' => "", 'folder' => 0, 'tags' => ["whee"]],
], ['url' => "", 'title' => "", 'folder' => 0, 'tags' => ["whee", "whoo", ""]],
[
'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' => "",
'title' => "",
'folder' => 0,
'tags' => ["whee"],
],
[
'url' => "",
'title' => "",
'folder' => 0,
'tags' => ["whee", "whoo", ""],
],
], []]], ], []]],
["FoldersOnly.opml", true, [[], []]], ["FoldersOnly.opml", true, [[], []]],
["FoldersOnly.opml", false, [[], [1 => ["FoldersOnly.opml", false, [[], [1 =>
[ ['id' => 1, 'name' => "Folder 1", 'parent' => 0],
'id' => 1, ['id' => 2, 'name' => "Folder 2", 'parent' => 0],
'name' => "Folder 1", ['id' => 3, 'name' => "Also a folder", 'parent' => 2],
'parent' => 0, ['id' => 4, 'name' => "Still a folder", 'parent' => 2],
], ['id' => 5, 'name' => "Folder 5", 'parent' => 4],
[ ['id' => 6, 'name' => "Folder 6", 'parent' => 0],
'id' => 2, ]]],
'name' => "Folder 2", ["MixedContent.opml", false, [[
'parent' => 0, ['url' => "https://www.jpl.nasa.gov/multimedia/rss/news.xml", 'title' => "NASA JPL", 'folder' => 3, 'tags' => ["tech"]],
], ['url' => "http://feeds.arstechnica.com/arstechnica/index/", 'title' => "Ars Technica", 'folder' => 2, 'tags' => ["frequent", "tech"]],
[ ['url' => "https://www.thestar.com/content/thestar/feed.RSSManagerServlet.topstories.rss", 'title' => "Toronto Star", 'folder' => 5, 'tags' => ["news", "canada", "toronto"]],
'id' => 3, ['url' => "http://rss.canada.com/get/?F239", 'title' => "Ottawa Citizen", 'folder' => 6, 'tags' => ["news", "canada"]],
'name' => "Also a folder", ['url' => "https://www.eurogamer.net/?format=rss", 'title' => "Eurogamer", 'folder' => 0, 'tags' => ["gaming", "frequent"]],
'parent' => 2, ], [1 =>
], ['id' => 1, 'name' => "Photography", 'parent' => 0],
[ ['id' => 2, 'name' => "Science", 'parent' => 0],
'id' => 4, ['id' => 3, 'name' => "Rocketry", 'parent' => 2],
'name' => "Still a folder", ['id' => 4, 'name' => "Politics", 'parent' => 0],
'parent' => 2, ['id' => 5, 'name' => "Local", 'parent' => 4],
], ['id' => 6, 'name' => "National", 'parent' => 4],
[
'id' => 5,
'name' => "Folder 5",
'parent' => 4,
],
[
'id' => 6,
'name' => "Folder 6",
'parent' => 0,
],
]]], ]]],
]; ];
} }

20
tests/docroot/Import/OPML/MixedContent.opml

@ -0,0 +1,20 @@
<opml>
<body>
<outline text="Photography"/>
<outline text="Science">
<outline text="Rocketry">
<outline type="rss" text="NASA JPL" xmlUrl="https://www.jpl.nasa.gov/multimedia/rss/news.xml" category="tech"/>
</outline>
<outline type="rss" text="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" category="frequent,tech"/>
</outline>
<outline text="Politics">
<outline text="Local">
<outline type="rss" text="Toronto Star" xmlUrl="https://www.thestar.com/content/thestar/feed.RSSManagerServlet.topstories.rss" category="news,canada,toronto"/>
</outline>
<outline text="National">
<outline type="rss" text="Ottawa Citizen" xmlUrl="http://rss.canada.com/get/?F239" category="news,canada"/>
</outline>
</outline>
<outline type="rss" text="Eurogamer" xmlUrl="https://www.eurogamer.net/?format=rss" category="gaming,frequent"/>
</body>
</opml>
Loading…
Cancel
Save