diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:27 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:38 +0100 |
commit | 95530f62513a82c385d9378b4a59da57d74092d9 (patch) | |
tree | a4d17994548999b42e99371f381da8c256ee39bf /3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php | |
parent | 57163ad25a7dc63abd8aff8663c185ddad398466 (diff) |
update picofeed, add max size setting, fix #642
Diffstat (limited to '3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php')
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php b/3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php new file mode 100644 index 000000000..fa68c05ca --- /dev/null +++ b/3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php @@ -0,0 +1,70 @@ +<?php +namespace PicoFeed\Serialization; + +use PHPUnit_Framework_TestCase; + + +class ExportTest extends PHPUnit_Framework_TestCase +{ + public function testOuput() + { + $feeds = array( + array( + 'title' => 'Site title', + 'description' => 'Optional description', + 'site_url' => 'http://blabla.fr/', + ), + array( + 'title' => 'Site title', + 'description' => 'Optional description', + 'site_url' => 'http://petitcodeur.fr/', + 'feed_url' => 'http://petitcodeur.fr/feed.xml', + ) + ); + + $export = new Export($feeds); + $opml = $export->execute(); + + $expected = '<?xml version="1.0" encoding="utf-8"?> +<opml><head><title>OPML Export</title></head><body><outline xmlUrl="http://petitcodeur.fr/feed.xml" htmlUrl="http://petitcodeur.fr/" title="Site title" text="Site title" description="Optional description" type="rss" version="RSS"/></body></opml> +'; + + $this->assertEquals($expected, $opml); + } + + public function testCategoryOuput() + { + $feeds = array( + 'my category' => array( + array( + 'title' => 'Site title', + 'description' => 'Optional description', + 'site_url' => 'http://blabla.fr/', + ), + array( + 'title' => 'Site title', + 'description' => 'Optional description', + 'site_url' => 'http://petitcodeur.fr/', + 'feed_url' => 'http://petitcodeur.fr/feed.xml', + ) + ), + 'another category' => array( + array( + 'title' => 'Site title', + 'description' => 'Optional description', + 'site_url' => 'http://youpi.ici/', + 'feed_url' => 'http://youpi.ici/feed.xml', + ) + ) + ); + + $export = new Export($feeds); + $opml = $export->execute(); + + $expected = '<?xml version="1.0" encoding="utf-8"?> +<opml><head><title>OPML Export</title></head><body><outline text="my category"><outline xmlUrl="http://petitcodeur.fr/feed.xml" htmlUrl="http://petitcodeur.fr/" title="Site title" text="Site title" description="Optional description" type="rss" version="RSS"/></outline><outline text="another category"><outline xmlUrl="http://youpi.ici/feed.xml" htmlUrl="http://youpi.ici/" title="Site title" text="Site title" description="Optional description" type="rss" version="RSS"/></outline></body></opml> +'; + + $this->assertEquals($expected, $opml); + } +}
\ No newline at end of file |