diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:29:09 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:29:09 +0100 |
commit | 73f65c8fbadbdd2098448e77b6d3f0464ad8613e (patch) | |
tree | f22ba63a222fb4f7d05427b661f3c008170047fd /vendor/fguillot/picofeed/tests/Syndication | |
parent | be37aed9f5d923fe16e264c6ffc97db08503b791 (diff) |
update picofeed
Diffstat (limited to 'vendor/fguillot/picofeed/tests/Syndication')
m--------- | vendor/fguillot/picofeed | 0 | ||||
-rw-r--r-- | vendor/fguillot/picofeed/tests/Syndication/AtomWriterTest.php | 90 | ||||
-rw-r--r-- | vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php | 85 |
3 files changed, 0 insertions, 175 deletions
diff --git a/vendor/fguillot/picofeed b/vendor/fguillot/picofeed new file mode 160000 +Subproject 0a1d0d3950f7f047dc8fb1d80aa6296e15f306d diff --git a/vendor/fguillot/picofeed/tests/Syndication/AtomWriterTest.php b/vendor/fguillot/picofeed/tests/Syndication/AtomWriterTest.php deleted file mode 100644 index 9d263fd2c..000000000 --- a/vendor/fguillot/picofeed/tests/Syndication/AtomWriterTest.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -namespace PicoFeed\Syndication; - -use PHPUnit_Framework_TestCase; - - -class AtomWriterTest extends PHPUnit_Framework_TestCase -{ - public function testWriter() - { - $writer = new Atom(); - $writer->title = 'My site'; - $writer->site_url = 'http://boo/'; - $writer->feed_url = 'http://boo/feed.atom'; - $writer->author = array( - 'name' => 'Me', - 'url' => 'http://me', - 'email' => 'me@here' - ); - - $writer->items[] = array( - 'title' => 'My article 1', - 'updated' => strtotime('-2 days'), - 'url' => 'http://foo/bar', - 'summary' => 'Super summary', - 'content' => '<p>content</p>' - ); - - $writer->items[] = array( - 'title' => 'My article 2', - 'updated' => strtotime('-1 day'), - 'url' => 'http://foo/bar2', - 'summary' => 'Super summary 2', - 'content' => '<p>content 2 © 2015</p>', - 'author' => array( - 'name' => 'Me too', - ) - ); - - $writer->items[] = array( - 'title' => 'My article 3', - 'url' => 'http://foo/bar3' - ); - - $generated_output = $writer->execute(); - - $expected_output = '<?xml version="1.0" encoding="UTF-8"?> -<feed xmlns="http://www.w3.org/2005/Atom"> - <generator uri="https://github.com/fguillot/picoFeed">PicoFeed</generator> - <title>My site</title> - <id>http://boo/</id> - <updated>'.date(DATE_ATOM).'</updated> - <link rel="alternate" type="text/html" href="http://boo/"/> - <link rel="self" type="application/atom+xml" href="http://boo/feed.atom"/> - <author> - <name>Me</name> - <email>me@here</email> - <uri>http://me</uri> - </author> - <entry> - <title>My article 1</title> - <id>http://foo/bar</id> - <updated>'.date(DATE_ATOM, strtotime('-2 days')).'</updated> - <link rel="alternate" type="text/html" href="http://foo/bar"/> - <summary>Super summary</summary> - <content type="html"><![CDATA[<p>content</p>]]></content> - </entry> - <entry> - <title>My article 2</title> - <id>http://foo/bar2</id> - <updated>'.date(DATE_ATOM, strtotime('-1 day')).'</updated> - <link rel="alternate" type="text/html" href="http://foo/bar2"/> - <summary>Super summary 2</summary> - <content type="html"><![CDATA[<p>content 2 © 2015</p>]]></content> - <author> - <name>Me too</name> - </author> - </entry> - <entry> - <title>My article 3</title> - <id>http://foo/bar3</id> - <updated>'.date(DATE_ATOM).'</updated> - <link rel="alternate" type="text/html" href="http://foo/bar3"/> - </entry> -</feed> -'; - - $this->assertEquals($expected_output, $generated_output); - } -}
\ No newline at end of file diff --git a/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php b/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php deleted file mode 100644 index 2c61b8537..000000000 --- a/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -namespace PicoFeed\Syndication; - -use PHPUnit_Framework_TestCase; - - -class Rss20WriterTest extends PHPUnit_Framework_TestCase -{ - public function testWriter() - { - $writer = new Rss20(); - $writer->title = 'My site'; - $writer->site_url = 'http://boo/'; - $writer->feed_url = 'http://boo/feed.atom'; - $writer->author = array( - 'name' => 'Me', - 'url' => 'http://me', - 'email' => 'me@here' - ); - - $writer->items[] = array( - 'title' => 'My article 1', - 'updated' => strtotime('-2 days'), - 'url' => 'http://foo/bar', - 'summary' => 'Super summary', - 'content' => '<p>content</p>' - ); - - $writer->items[] = array( - 'title' => 'My article 2', - 'updated' => strtotime('-1 day'), - 'url' => 'http://foo/bar2', - 'summary' => 'Super summary 2', - 'content' => '<p>content 2 © 2015</p>', - 'author' => array( - 'name' => 'Me too', - ) - ); - - $writer->items[] = array( - 'title' => 'My article 3', - 'url' => 'http://foo/bar3' - ); - - $generated_output = $writer->execute(); - - $expected_output = '<?xml version="1.0" encoding="UTF-8"?> -<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <generator>PicoFeed (https://github.com/fguillot/picoFeed)</generator> - <title>My site</title> - <description>My site</description> - <pubDate>'.date(DATE_RFC822).'</pubDate> - <atom:link href="http://boo/feed.atom" rel="self" type="application/rss+xml"/> - <link>http://boo/</link> - <webMaster>me@here (Me)</webMaster> - <item> - <title>My article 1</title> - <link>http://foo/bar</link> - <guid isPermaLink="true">http://foo/bar</guid> - <pubDate>'.date(DATE_RFC822, strtotime('-2 days')).'</pubDate> - <description>Super summary</description> - <content:encoded><![CDATA[<p>content</p>]]></content:encoded> - </item> - <item> - <title>My article 2</title> - <link>http://foo/bar2</link> - <guid isPermaLink="true">http://foo/bar2</guid> - <pubDate>'.date(DATE_RFC822, strtotime('-1 day')).'</pubDate> - <description>Super summary 2</description> - <content:encoded><![CDATA[<p>content 2 © 2015</p>]]></content:encoded> - </item> - <item> - <title>My article 3</title> - <link>http://foo/bar3</link> - <guid isPermaLink="true">http://foo/bar3</guid> - <pubDate>'.date(DATE_RFC822).'</pubDate> - </item> - </channel> -</rss> -'; - - $this->assertEquals($expected_output, $generated_output); - } -}
\ No newline at end of file |