diff --git a/test/Reader/Entry/CommonTest.php b/test/Reader/Entry/CommonTest.php index a0f5167c..ff5dc9d5 100644 --- a/test/Reader/Entry/CommonTest.php +++ b/test/Reader/Entry/CommonTest.php @@ -72,7 +72,9 @@ public function testSaveXmlOutputsXmlStringForEntry() file_get_contents($this->feedSamplePath.'/atom.xml') ); $entry = $feed->current(); - $this->assertEquals($entry->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml')); + $expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'); + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $entry->saveXml()); } public function testGetsNamedExtension() diff --git a/test/Reader/Feed/CommonTest.php b/test/Reader/Feed/CommonTest.php index 1e9b330a..2cacb3d8 100644 --- a/test/Reader/Feed/CommonTest.php +++ b/test/Reader/Feed/CommonTest.php @@ -66,7 +66,9 @@ public function testSaveXmlOutputsXmlStringForFeed() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath.'/atom.xml') ); - $this->assertEquals($feed->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml')); + $expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'); + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $feed->saveXml()); } public function testGetsNamedExtension() diff --git a/test/Reader/Integration/PodcastRss2Test.php b/test/Reader/Integration/PodcastRss2Test.php index 9e7866e2..342ad8f5 100644 --- a/test/Reader/Integration/PodcastRss2Test.php +++ b/test/Reader/Integration/PodcastRss2Test.php @@ -96,10 +96,12 @@ public function testGetsDescription() $feed = Reader\Reader::importString( file_get_contents($this->feedSamplePath) ); - $this->assertEquals('All About Everything is a show about everything. + $expected = 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the - iTunes Store', $feed->getDescription()); + iTunes Store'; + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $feed->getDescription()); } public function testGetsLanguage() @@ -205,8 +207,10 @@ public function testGetsSubtitle() file_get_contents($this->feedSamplePath) ); $entry = $feed->current(); - $this->assertEquals('A short primer on table spices - ', $entry->getSubtitle()); + $expected = 'A short primer on table spices + '; + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $entry->getSubtitle()); } public function testGetsSummary() @@ -215,10 +219,12 @@ public function testGetsSummary() file_get_contents($this->feedSamplePath) ); $entry = $feed->current(); - $this->assertEquals('This week we talk about salt and pepper + $expected = 'This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and - join the party!', $entry->getSummary()); + join the party!'; + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $entry->getSummary()); } public function testGetsDuration() @@ -236,8 +242,10 @@ public function testGetsKeywords() file_get_contents($this->feedSamplePath) ); $entry = $feed->current(); - $this->assertEquals('salt, pepper, shaker, exciting - ', $entry->getKeywords()); + $expected = 'salt, pepper, shaker, exciting + '; + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEquals($expected, $entry->getKeywords()); } public function testGetsEntryEncoding() diff --git a/test/Reader/ReaderTest.php b/test/Reader/ReaderTest.php index 937438fb..4670b6d1 100644 --- a/test/Reader/ReaderTest.php +++ b/test/Reader/ReaderTest.php @@ -264,6 +264,11 @@ public function testRegistersUserExtension() $this->assertTrue(Reader\Reader::isRegistered('JungleBooks')); } + /** + * This test is failing on windows: + * Failed asserting that exception of type "Zend\Feed\Reader\Exception\RuntimeException" matches expected exception "Zend\Feed\Reader\Exception\InvalidArgumentException". Message was: "DOMDocument cannot parse XML: Entity 'discloseInfo' failed to parse". + * @todo why is the assertEquals commented out? + */ public function testXxePreventionOnFeedParsing() { $this->setExpectedException('Zend\Feed\Reader\Exception\InvalidArgumentException'); diff --git a/test/Writer/FeedTest.php b/test/Writer/FeedTest.php index cefdbb0c..4836e4bc 100644 --- a/test/Writer/FeedTest.php +++ b/test/Writer/FeedTest.php @@ -1021,6 +1021,7 @@ public function testExportRss() EOT; $feed = str_replace('%version%', Version::VERSION, $feed); + $feed = str_replace("\r\n", "\n", $feed); $this->assertEquals($feed, $export); } @@ -1042,6 +1043,7 @@ public function testExportRssIgnoreExceptions() EOT; $feed = str_replace('%version%', Version::VERSION, $feed); + $feed = str_replace("\r\n", "\n", $feed); $this->assertEquals($feed, $export); }