diff options
Diffstat (limited to '3rdparty/fguillot/picofeed/tests')
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/ClientTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ClientTest.php) | 10 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/CurlTest.php (renamed from 3rdparty/fguillot/picofeed/tests/CurlTest.php) | 41 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/FaviconTest.php (renamed from 3rdparty/fguillot/picofeed/tests/FaviconTest.php) | 5 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/GrabberTest.php (renamed from 3rdparty/fguillot/picofeed/tests/GrabberTest.php) | 18 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/StreamTest.php (renamed from 3rdparty/fguillot/picofeed/tests/StreamTest.php) | 34 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Client/UrlTest.php (renamed from 3rdparty/fguillot/picofeed/tests/UrlTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Filter/AttributeFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AttributeFilterTest.php) | 7 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Filter/FilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/FilterTest.php) | 7 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Filter/HtmlFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/HtmlFilterTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/TagFilterTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/AtomParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AtomParserTest.php) | 76 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ParserTest.php) | 30 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/Rss10ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss10ParserTest.php) | 39 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/Rss20ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss20ParserTest.php) | 114 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/Rss91ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss91ParserTest.php) | 8 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/Rss92ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss92ParserTest.php) | 17 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Parser/XmlParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/XmlParserTest.php) | 6 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Reader/ReaderTest.php | 157 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/ReaderTest.php | 108 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ExportTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Serialization/ImportTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ImportTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Syndication/AtomWriterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AtomWriterTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss20WriterTest.php) | 4 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/fixtures/groovehq.xml | 1767 | ||||
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/fixtures/womensweardaily.xml | 63 |
25 files changed, 2095 insertions, 440 deletions
diff --git a/3rdparty/fguillot/picofeed/tests/ClientTest.php b/3rdparty/fguillot/picofeed/tests/Client/ClientTest.php index 10bf49b69..98a963644 100644 --- a/3rdparty/fguillot/picofeed/tests/ClientTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/ClientTest.php @@ -1,8 +1,8 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Client; class ClientTest extends PHPUnit_Framework_TestCase { @@ -72,14 +72,12 @@ class ClientTest extends PHPUnit_Framework_TestCase { $client = Client::getInstance(); $client->setUrl('http://php.net/'); - - $this->assertTrue($client->execute()); + $client->execute(); $this->assertEquals('utf-8', $client->getEncoding()); $client = Client::getInstance(); $client->setUrl('http://php.net/robots.txt'); - - $this->assertTrue($client->execute()); + $client->execute(); $this->assertEquals('', $client->getEncoding()); } }
\ No newline at end of file diff --git a/3rdparty/fguillot/picofeed/tests/CurlTest.php b/3rdparty/fguillot/picofeed/tests/Client/CurlTest.php index e8b3b70f0..668816036 100644 --- a/3rdparty/fguillot/picofeed/tests/CurlTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/CurlTest.php @@ -1,9 +1,8 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Clients/Curl.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Clients\Curl; class CurlTest extends PHPUnit_Framework_TestCase { @@ -32,33 +31,23 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->assertEquals('text/html; charset=utf-8', $result['headers']['Content-Type']); } + /** + * @expectedException PicoFeed\Client\InvalidCertificateException + */ + public function testSSL() + { + $client = new Curl; + $client->setUrl('https://www.mjvmobile.com.br'); + $client->doRequest(); + } - // public function testInfiniteRedirect() - // { - // $client = new Curl; - // $client->url = 'http://www.accupass.com/home/rss/%E8%AA%B2%E7%A8%8B%E8%AC%9B%E5%BA%A7'; - // $result = $client->doRequest(); - - // $this->assertFalse($result); - // } - - + /** + * @expectedException PicoFeed\Client\InvalidUrlException + */ public function testBadUrl() { $client = new Curl; $client->setUrl('http://12345gfgfgf'); - $result = $client->doRequest(); - - $this->assertFalse($result); + $client->doRequest(); } - - - // public function testAbortOnLargeBody() - // { - // $client = new Curl; - // $client->setUrl('http://duga.jp/ror.xml'); - // $result = $client->doRequest(); - - // $this->assertFalse($result); - // } }
\ No newline at end of file diff --git a/3rdparty/fguillot/picofeed/tests/FaviconTest.php b/3rdparty/fguillot/picofeed/tests/Client/FaviconTest.php index 46ac13461..c0ac11ac6 100644 --- a/3rdparty/fguillot/picofeed/tests/FaviconTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/FaviconTest.php @@ -1,9 +1,8 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Favicon; -use PicoFeed\Url; class FaviconTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/GrabberTest.php b/3rdparty/fguillot/picofeed/tests/Client/GrabberTest.php index 001b1e084..5aec5ca11 100644 --- a/3rdparty/fguillot/picofeed/tests/GrabberTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/GrabberTest.php @@ -1,11 +1,10 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Grabber.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Reader; -use PicoFeed\Grabber; -use PicoFeed\Logging; +use PicoFeed\Reader\Reader; +use PicoFeed\Logging\Logging; class GrabberTest extends PHPUnit_Framework_TestCase { @@ -50,12 +49,9 @@ class GrabberTest extends PHPUnit_Framework_TestCase public function testRssGrabContent() { $reader = new Reader; - $reader->download('http://www.egscomics.com/rss.php'); - - $parser = $reader->getParser(); - $this->assertTrue($parser !== false); - - $parser->grabber = true; + $client = $reader->download('http://www.egscomics.com/rss.php'); + $parser = $reader->getParser($client->getUrl(), $client->getContent(), $client->getEncoding()); + $parser->enableContentGrabber(); $feed = $parser->execute(); $this->assertTrue(is_array($feed->items)); diff --git a/3rdparty/fguillot/picofeed/tests/StreamTest.php b/3rdparty/fguillot/picofeed/tests/Client/StreamTest.php index 49bd3d083..8b2e2f8b8 100644 --- a/3rdparty/fguillot/picofeed/tests/StreamTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/StreamTest.php @@ -1,9 +1,8 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Clients/Stream.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Clients\Stream; class StreamTest extends PHPUnit_Framework_TestCase { @@ -13,7 +12,6 @@ class StreamTest extends PHPUnit_Framework_TestCase $client->setUrl('http://www.reddit.com/r/dwarffortress/.rss'); $result = $client->doRequest(); - $this->assertNotFalse($result); $this->assertEquals('</rss>', substr($result['body'], -6)); } @@ -23,7 +21,6 @@ class StreamTest extends PHPUnit_Framework_TestCase $client->setUrl('https://github.com/fguillot/picoFeed'); $result = $client->doRequest(); - $this->assertNotFalse($result); $this->assertEquals(200, $result['status']); $this->assertEquals('text/html; charset=utf-8', $result['headers']['Content-Type']); $this->assertEquals('<!DOCTYPE html>', substr(trim($result['body']), 0, 15)); @@ -36,40 +33,22 @@ class StreamTest extends PHPUnit_Framework_TestCase $client->setUrl('http://github.com/fguillot/picoFeed'); $result = $client->doRequest(); - $this->assertNotFalse($result); $this->assertEquals(200, $result['status']); $this->assertEquals('<!DOCTYPE html>', substr(trim($result['body']), 0, 15)); $this->assertEquals('text/html; charset=utf-8', $result['headers']['Content-Type']); } -/* - public function testInfiniteRedirect() - { - $client = new Stream; - $client->url = 'http://www.accupass.com/home/rss/%E8%AA%B2%E7%A8%8B%E8%AC%9B%E5%BA%A7'; - $result = $client->doRequest(); - $this->assertFalse($result); - } -*/ + /** + * @expectedException PicoFeed\Client\InvalidUrlException + */ public function testBadUrl() { $client = new Stream; $client->setUrl('http://12345gfgfgf'); $client->setTimeout(1); - $result = $client->doRequest(); - - $this->assertFalse($result); + $client->doRequest(); } - /*public function testAbortOnLargeBody() - { - $client = new Stream; - $client->url = 'http://duga.jp/ror.xml'; - $result = $client->doRequest(); - - $this->assertFalse($result); - }*/ - public function testDecodeGzip() { if (function_exists('gzdecode')) { @@ -77,7 +56,6 @@ class StreamTest extends PHPUnit_Framework_TestCase $client->setUrl('https://github.com/fguillot/picoFeed'); $result = $client->doRequest(); - $this->assertNotFalse($result); $this->assertEquals('gzip', $result['headers']['Content-Encoding']); $this->assertEquals('<!DOC', substr(trim($result['body']), 0, 5)); } diff --git a/3rdparty/fguillot/picofeed/tests/UrlTest.php b/3rdparty/fguillot/picofeed/tests/Client/UrlTest.php index 35395914d..a07898778 100644 --- a/3rdparty/fguillot/picofeed/tests/UrlTest.php +++ b/3rdparty/fguillot/picofeed/tests/Client/UrlTest.php @@ -1,8 +1,8 @@ <?php +namespace PicoFeed\Client; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Url; class UrlTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/AttributeFilterTest.php b/3rdparty/fguillot/picofeed/tests/Filter/AttributeFilterTest.php index 58e1b114d..e4de74aaf 100644 --- a/3rdparty/fguillot/picofeed/tests/AttributeFilterTest.php +++ b/3rdparty/fguillot/picofeed/tests/Filter/AttributeFilterTest.php @@ -1,9 +1,10 @@ <?php +namespace PicoFeed\Filter; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; + +use PicoFeed\Client\Url; -use PicoFeed\Url; -use PicoFeed\Filter\Attribute; class AttributeFilterTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/FilterTest.php b/3rdparty/fguillot/picofeed/tests/Filter/FilterTest.php index 2fe0d10a3..f3b736dfb 100644 --- a/3rdparty/fguillot/picofeed/tests/FilterTest.php +++ b/3rdparty/fguillot/picofeed/tests/Filter/FilterTest.php @@ -1,9 +1,10 @@ <?php +namespace PicoFeed\Filter; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; + +use PicoFeed\Config\Config; -use PicoFeed\Filter; -use PicoFeed\Config; class FilterTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/HtmlFilterTest.php b/3rdparty/fguillot/picofeed/tests/Filter/HtmlFilterTest.php index 5d6aaa3b2..271167481 100644 --- a/3rdparty/fguillot/picofeed/tests/HtmlFilterTest.php +++ b/3rdparty/fguillot/picofeed/tests/Filter/HtmlFilterTest.php @@ -1,8 +1,8 @@ <?php +namespace PicoFeed\Filter; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Filter\Html; class HtmlFilterTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/TagFilterTest.php b/3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php index b66c7098b..86911bbb4 100644 --- a/3rdparty/fguillot/picofeed/tests/TagFilterTest.php +++ b/3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php @@ -1,8 +1,8 @@ <?php +namespace PicoFeed\Filter; -require_once 'lib/PicoFeed/PicoFeed.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Filter\Tag; class TagFilterTest extends PHPUnit_Framework_TestCase { diff --git a/3rdparty/fguillot/picofeed/tests/AtomParserTest.php b/3rdparty/fguillot/picofeed/tests/Parser/AtomParserTest.php index 09cd4bea2..491c7e3e0 100644 --- a/3rdparty/fguillot/picofeed/tests/AtomParserTest.php +++ b/3rdparty/fguillot/picofeed/tests/Parser/AtomParserTest.php @@ -1,30 +1,28 @@ <?php +namespace PicoFeed\Parser; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Parsers/Atom.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Parsers\Atom; class AtomParserTest extends PHPUnit_Framework_TestCase { + /** + * @expectedException PicoFeed\Parser\MalformedXmlException + */ public function testBadInput() { $parser = new Atom('boo'); - $this->assertFalse($parser->execute()); + $parser->execute(); } public function testFeedTitle() { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('The Official Google Blog', $feed->getTitle()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('Example Feed', $feed->getTitle()); } @@ -32,14 +30,10 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('Insights from Googlers into our products, technology, and the Google culture.', $feed->getDescription()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('', $feed->getDescription()); } @@ -47,14 +41,10 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('', $feed->getLogo()); $parser = new Atom(file_get_contents('tests/fixtures/bbc_urdu.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://www.bbc.co.uk/urdu/images/gel/rss_logo.gif', $feed->getLogo()); } @@ -62,20 +52,14 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://googleblog.blogspot.com/', $feed->getUrl()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://example.org/', $feed->getUrl()); $parser = new Atom(file_get_contents('tests/fixtures/lagrange.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://www.la-grange.net/', $feed->getUrl()); } @@ -83,14 +67,10 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('tag:blogger.com,1999:blog-10861780', $feed->getId()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6', $feed->getId()); } @@ -98,14 +78,10 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals(1360148333, $feed->getDate()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals(1071340202, $feed->getDate()); } @@ -113,23 +89,17 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('', $feed->getLanguage()); $this->assertEquals('', $feed->items[0]->getLanguage()); $parser = new Atom(file_get_contents('tests/fixtures/bbc_urdu.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('ur', $feed->getLanguage()); $this->assertEquals('ur', $feed->items[0]->getLanguage()); $parser = new Atom(file_get_contents('tests/fixtures/lagrange.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('fr', $feed->getLanguage()); $this->assertEquals('fr', $feed->items[0]->getLanguage()); @@ -139,18 +109,14 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); - $this->assertEquals('34ce9ad8', $feed->items[0]->getId()); + $this->assertEquals('3841e5cf232f5111fc5841e9eba5f4b26d95e7d7124902e0f7272729d65601a6', $feed->items[0]->getId()); } public function testItemUrl() { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('http://feedproxy.google.com/~r/blogspot/MKuf/~3/S_hccisqTW8/a-chrome-experiment-made-with-some.html', $feed->items[0]->getUrl()); } @@ -159,8 +125,6 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('Safer Internet Day: How we help you stay secure online', $feed->items[1]->getTitle()); } @@ -169,15 +133,11 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals(1360011661, $feed->items[1]->getDate()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals(1071340202, $feed->items[0]->getDate()); } @@ -186,8 +146,6 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('', $feed->items[1]->getLanguage()); } @@ -196,15 +154,11 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('Emily Wood', $feed->items[1]->getAuthor()); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertEquals('John Doe', $feed->items[0]->getAuthor()); } @@ -213,28 +167,12 @@ class AtomParserTest extends PHPUnit_Framework_TestCase { $parser = new Atom(file_get_contents('tests/fixtures/atom.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertTrue(strpos($feed->items[1]->getContent(), '<p>Technology can') === 0); $parser = new Atom(file_get_contents('tests/fixtures/atomsample.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertNotEmpty($feed->items); $this->assertTrue(strpos($feed->items[0]->getContent(), '<p>Some text.') === 0); } -/* - public function testItemEnclosure() - { - $parser = new Atom(file_get_contents('tests/fixtures/rue89.xml')); - $feed = $parser->execute(); - - $this->assertNotFalse($feed); - $this->assertNotEmpty($feed->items); - $this->assertEquals('http://rue89.feedsportal.com/c/33822/f/608948/e/1/s/2a687021/l/0L0Srue890N0Csites0Cnews0Cfiles0Cstyles0Cmosaic0Cpublic0Czapnet0Cthumbnail0Isquare0C20A130C0A40Ccahuzac0I10Bpng/cahuzac_1.png', $feed->items[0]->getEnclosureUrl()); - $this->assertEquals('image/png', $feed->items[0]->getEnclosureType()); - } -*/ }
\ No newline at end of file diff --git a/3rdparty/fguillot/picofeed/tests/ParserTest.php b/3rdparty/fguillot/picofeed/tests/Parser/ParserTest.php index 502e4d4fd..3be864507 100644 --- a/3rdparty/fguillot/picofeed/tests/ParserTest.php +++ b/3rdparty/fguillot/picofeed/tests/Parser/ParserTest.php @@ -1,11 +1,8 @@ <?php +namespace PicoFeed\Parser; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Parsers/Rss20.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\XmlParser; -use PicoFeed\Parser; -use PicoFeed\Parsers\Rss20; class ParserTest extends PHPUnit_Framework_TestCase { @@ -48,31 +45,10 @@ class ParserTest extends PHPUnit_Framework_TestCase $this->assertEquals(time(), $parser->parseDate('+0400')); } -/* - public function testNormalizeData() - { - $parser = new Rss20(''); - - $data = '<title> Police 'Like' Wanted Suspect's Facebook Post</title> - <link rel="alternate" type="text/html" href="http://www.huffingtonpost.com/huff-wires/20140121/us-odd--police-like-facebook-post/?utm_hp_ref=travel&ir=travel" /> - <id>http://www.huffingtonpost.com/2014/01/22/anthony-lescowitch-facebook_n_4643239.html</id> - <truc href="blabla &"/>'; - - $result = $parser->replaceEntityAttribute($data); - - $expected = '<title> Police 'Like' Wanted Suspect's Facebook Post</title> - <link rel="alternate" type="text/html" href="http://www.huffingtonpost.com/huff-wires/20140121/us-odd--police-like-facebook-post/?utm_hp_ref=travel&ir=travel" /> - <id>http://www.huffingtonpost.com/2014/01/22/anthony-lescowitch-facebook_n_4643239.html</id> - <truc href="blabla &"/>'; - - $this->assertEquals($expected, $result); - } -*/ - public function testChangeHashAlgo() { $parser = new Rss20(''); - $this->assertEquals('9e83486d', $parser->generateId('a', 'b')); + $this->assertEquals('fb8e20fc2e4c3f248c60c39bd652f3c1347298bb977b8b4d5903b85055620603', $parser->generateId('a', 'b')); $parser->setHashAlgo('sha1'); $this->assertEquals('da23614e02469a0d7c7bd1bdab5c9c474b1904dc', $parser->generateId('a', 'b')); diff --git a/3rdparty/fguillot/picofeed/tests/Rss10ParserTest.php b/3rdparty/fguillot/picofeed/tests/Parser/Rss10ParserTest.php index cd79226fb..bc0824502 100644 --- a/3rdparty/fguillot/picofeed/tests/Rss10ParserTest.php +++ b/3rdparty/fguillot/picofeed/tests/Parser/Rss10ParserTest.php @@ -1,24 +1,24 @@ <?php +namespace PicoFeed\Parser; -require_once 'lib/PicoFeed/PicoFeed.php'; -require_once 'lib/PicoFeed/Parsers/Rss10.php'; +use PHPUnit_Framework_TestCase; -use PicoFeed\Parsers\Rss10; class Rss10ParserTest extends PHPUnit_Framework_TestCase { + /** + * @expectedException PicoFeed\Parser\MalformedXmlException + */ public function testBadInput() { $parser = new Rss10('boo'); - $this->assertFalse($parser->execute()); + $parser->execute(); } public function testFeedTitle() { $parser = new Rss10(file_get_contents('tests/fixtures/planete-jquery.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals("Planète jQuery : l'actualité jQuery, plugins jQuery et tutoriels jQuery en français", $feed->getTitle()); } @@ -26,8 +26,6 @@ class Rss10ParserTest extends PHPUnit_Framework_TestCase { $parser = new Rss10(file_get_contents('tests/fixtures/planete-jquery.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://planete-jquery.fr', $feed->getUrl()); } @@ -35,8 +33,6 @@ class Rss10ParserTest extends PHPUnit_Framework_TestCase { $parser = new Rss10(file_get_contents('tests/fixtures/planete-jquery.xml')); $feed = $parser->execute(); - - $this->assertNotFalse($feed); $this->assertEquals('http://planete-jquery.fr', $feed->getId()); } @@ -44,8 +40,6 @@ class Rss10 |