From 5a5eda55dcdb636e243bb4afcdac2e1cc6f4787a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 31 Mar 2015 10:18:08 +0200 Subject: update picofeed --- vendor/bin/picofeed | 1 + vendor/composer/installed.json | 14 ++-- vendor/fguillot/picofeed/composer.json | 8 ++- .../fguillot/picofeed/docs/feed-parsing.markdown | 77 ++++++++++++++++++++++ .../picofeed/lib/PicoFeed/Filter/Attribute.php | 3 +- .../fguillot/picofeed/lib/PicoFeed/Parser/Item.php | 41 ++++++++++++ .../picofeed/lib/PicoFeed/Parser/Parser.php | 3 + .../picofeed/lib/PicoFeed/Parser/XmlParser.php | 30 +-------- .../picofeed/lib/PicoFeed/Reader/Reader.php | 14 ++-- .../picofeed/lib/PicoFeed/Rules/.phoronix.com.php | 2 +- .../lib/PicoFeed/Rules/lesjoiesducode.fr.php | 2 +- .../lib/PicoFeed/Rules/monwindowsphone.com.php | 4 +- .../fguillot/picofeed/tests/Client/ClientTest.php | 22 +++++++ vendor/fguillot/picofeed/tests/Client/CurlTest.php | 8 +++ .../fguillot/picofeed/tests/Client/GrabberTest.php | 12 ++++ .../fguillot/picofeed/tests/Client/StreamTest.php | 13 ++++ .../picofeed/tests/Parser/Rss20ParserTest.php | 2 +- .../picofeed/tests/Parser/XmlParserTest.php | 64 +++++++++++++++++- .../fguillot/picofeed/tests/Reader/FaviconTest.php | 18 +++++ .../fguillot/picofeed/tests/Reader/ReaderTest.php | 12 ++++ 20 files changed, 306 insertions(+), 44 deletions(-) create mode 120000 vendor/bin/picofeed (limited to 'vendor') diff --git a/vendor/bin/picofeed b/vendor/bin/picofeed new file mode 120000 index 000000000..0307acc11 --- /dev/null +++ b/vendor/bin/picofeed @@ -0,0 +1 @@ +../fguillot/picofeed/picofeed \ No newline at end of file diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a3033136b..0d41799e2 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -119,12 +119,12 @@ "source": { "type": "git", "url": "https://github.com/fguillot/picoFeed.git", - "reference": "a006fc10642fbdc5414bebd6542aeabd35f8c98b" + "reference": "7c28753d5936ba635435a8e0e941dcabee67b243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/a006fc10642fbdc5414bebd6542aeabd35f8c98b", - "reference": "a006fc10642fbdc5414bebd6542aeabd35f8c98b", + "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/7c28753d5936ba635435a8e0e941dcabee67b243", + "reference": "7c28753d5936ba635435a8e0e941dcabee67b243", "shasum": "" }, "require": { @@ -135,7 +135,13 @@ "ext-xml": "*", "php": ">=5.3.0" }, - "time": "2015-03-03 03:14:01", + "suggest": { + "ext-curl": "PicoFeed will use cURL if present" + }, + "time": "2015-03-30 23:34:59", + "bin": [ + "picofeed" + ], "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/fguillot/picofeed/composer.json b/vendor/fguillot/picofeed/composer.json index be2e24e19..4c13bd6ab 100644 --- a/vendor/fguillot/picofeed/composer.json +++ b/vendor/fguillot/picofeed/composer.json @@ -18,7 +18,13 @@ "ext-libxml": "*", "ext-SimpleXML": "*" }, + "suggest": { + "ext-curl": "PicoFeed will use cURL if present" + }, "autoload": { "psr-0": {"PicoFeed": "lib/"} - } + }, + "bin" : [ + "picofeed" + ] } diff --git a/vendor/fguillot/picofeed/docs/feed-parsing.markdown b/vendor/fguillot/picofeed/docs/feed-parsing.markdown index 6e7f2fdc2..1ee21451d 100644 --- a/vendor/fguillot/picofeed/docs/feed-parsing.markdown +++ b/vendor/fguillot/picofeed/docs/feed-parsing.markdown @@ -176,6 +176,44 @@ catch (PicoFeedException $e) { } ``` +HTTP basic auth +--------------- +If a feed requires basic auth headers, you can pass them as parameters to the **download** method, e.g.: + +```php +try { + $reader = new Reader; + + $user = 'john'; + $password = 'doe'; + + // Provide those values to the download method + $resource = $reader->download('http://linuxfr.org/news.atom', '', '', $user, $password); + + // Return true if the remote content has changed + if ($resource->isModified()) { + + $parser = $reader->getParser( + $resource->getUrl(), + $resource->getContent(), + $resource->getEncoding() + ); + + $feed = $parser->execute(); + + // Save your feed in your database + // ... + + } + else { + + echo 'Not modified, nothing to do!'; + } +} +catch (PicoFeedException $e) { + // Do something... +} +``` Feed and item properties ------------------------ @@ -205,6 +243,45 @@ $feed->items[0]->getContent(); // Item content (filtered or raw) $feed->items[0]->isRTL(); // Return true if the item language is Right-To-Left ``` +Get raw XML tags/attributes or non standard tags for items +---------------------------------------------------------- + +Get the original `guid` tag for RSS 2.0 feeds: + +```php +echo $feed->items[0]->getTag('guid'); +``` + +Get a specific attribute value: + +```php +echo $feed->items[1]->getTag('category', 'term'); +``` + +Get value of namespaced tag: + +```php +echo $feed->items[1]->getTag('wfw:commentRss'); +``` + +Get attribute value of a namespaced tag: + +```php +echo $feed->items[0]->getTag('media:content', 'url'); +``` + +Get the xml of the item (returns a SimpleXMLElement instance): + +```php +$simplexml = $feed->items[0]->xml; +``` + +Get the list of namespaces: + +```php +print_r($feed->items[0]->namespaces); +``` + RTL language detection ---------------------- diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php index e8012dd98..ae77ff714 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php @@ -215,7 +215,8 @@ class Attribute * @var array */ private $add_attributes = array( - 'a' => array('rel' => 'noreferrer', 'target' => '_blank') + 'a' => array('rel' => 'noreferrer', 'target' => '_blank'), + 'video' => array('controls' => 'true'), ); /** diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php index 1585131c7..d891ef41c 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php @@ -99,6 +99,47 @@ class Item */ public $language = ''; + /** + * Raw XML + * + * @access public + * @var \SimpleXMLElement + */ + public $xml; + + /** + * List of namespaces + * + * @access public + * @var array + */ + public $namespaces = array(); + + /** + * Get specific XML tag or attribute value + * + * @access public + * @param string $tag Tag name (examples: guid, media:content) + * @param string $attribute Tag attribute + * @return string + */ + public function getTag($tag, $attribute = '') + { + // Get namespaced value + if (strpos($tag, ':') !== false) { + list(,$tag) = explode(':', $tag); + return XmlParser::getNamespaceValue($this->xml, $this->namespaces, $tag, $attribute); + } + + // Return attribute value + if (! empty($attribute)) { + return (string) $this->xml->{$tag}[$attribute]; + } + + // Return tag content + return (string) $this->xml->$tag; + } + /** * Return item information * diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php index 4d45f539c..7ef904f0a 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php @@ -153,6 +153,9 @@ abstract class Parser foreach ($this->getItemsTree($xml) as $entry) { $item = new Item; + $item->xml = $entry; + $item->namespaces = $this->namespaces; + $this->findItemAuthor($xml, $entry, $item); $this->findItemUrl($entry, $item); diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php index 2c68c50a5..feda8c254 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php @@ -212,21 +212,7 @@ class XmlParser } /** - * Extract charset from meta tag - * - * @static - * @access public - * @param string $data meta tag content - * @return string - */ - public static function findCharset($data) - { - $result = explode('charset=', $data); - return isset($result[1]) ? $result[1] : $data; - } - - /** - * Get the encoding from a xml tag + * Get the charset from a meta tag * * @static * @access public @@ -237,18 +223,8 @@ class XmlParser { $encoding = ''; - $dom = static::getHtmlDocument($data); - $xpath = new DOMXPath($dom); - - $tags = array( - '/html/head/meta[translate(@http-equiv, "CENOPTY", "cenopty")="content-type"]/@content', //HTML4, convert upper to lower-case - '/html/head/meta/@charset', //HTML5 - ); - - $nodes = $xpath->query(implode(' | ', $tags)); - - foreach ($nodes as $node) { - $encoding = static::findCharset($node->nodeValue); + if (preg_match('/;]+)/i', $data, $match) === 1) { + $encoding = strtolower($match[1]); } return $encoding; diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php b/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php index fd629f094..ea3c4f299 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php @@ -58,9 +58,11 @@ class Reader * @param string $url Feed url * @param string $last_modified Last modified HTTP header * @param string $etag Etag HTTP header + * @param string $username HTTP basic auth username + * @param string $password HTTP basic auth password * @return \PicoFeed\Client\Client */ - public function download($url, $last_modified = '', $etag = '') + public function download($url, $last_modified = '', $etag = '', $username = '', $password = '') { $url = $this->prependScheme($url); @@ -68,6 +70,8 @@ class Reader ->setConfig($this->config) ->setLastModified($last_modified) ->setEtag($etag) + ->setUsername($username) + ->setPassword($password) ->execute($url); } @@ -78,11 +82,13 @@ class Reader * @param string $url Feed or website url * @param string $last_modified Last modified HTTP header * @param string $etag Etag HTTP header + * @param string $username HTTP basic auth username + * @param string $password HTTP basic auth password * @return \PicoFeed\Client\Client */ - public function discover($url, $last_modified = '', $etag = '') + public function discover($url, $last_modified = '', $etag = '', $username = '', $password = '') { - $client = $this->download($url, $last_modified, $etag); + $client = $this->download($url, $last_modified, $etag, $username, $password); // It's already a feed or the feed was not modified if (! $client->isModified() || $this->detectFormat($client->getContent())) { @@ -96,7 +102,7 @@ class Reader throw new SubscriptionNotFoundException('Unable to find a subscription'); } - return $this->download($links[0], $last_modified, $etag); + return $this->download($links[0], $last_modified, $etag, $username, $password); } /** diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/.phoronix.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/.phoronix.com.php index 0d10eff28..0fd99f7b6 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/.phoronix.com.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/.phoronix.com.php @@ -2,7 +2,7 @@ return array( 'test_url' => 'http://www.phoronix.com/scan.php?page=article&item=amazon_ec2_bare&num=1', 'body' => array( - '//article[@class="KonaBody"]', + '//div[@class="KonaBody"]', ), 'strip' => array( ) diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/lesjoiesducode.fr.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/lesjoiesducode.fr.php index 3ade94b94..68e097ab3 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/lesjoiesducode.fr.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/lesjoiesducode.fr.php @@ -2,7 +2,7 @@ return array( 'test_url' => 'http://lesjoiesducode.fr/post/75576211207/quand-lappli-ne-fonctionne-plus-sans-aucune-raison', 'body' => array( - '//div[@class="post"]//img', + '//div[@class="blog-post-content"]', ), 'strip' => array( ) diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/monwindowsphone.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/monwindowsphone.com.php index be7f208a3..cfc4b2d08 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/monwindowsphone.com.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/monwindowsphone.com.php @@ -2,8 +2,8 @@ return array( 'test_url' => 'http://www.monwindowsphone.com/tout-savoir-sur-le-centre-d-action-de-windows-phone-8-1-t40574.html', 'body' => array( - '//div[@class="postmessage"]' + '//div[@class="blog-post-body"]' ), 'strip' => array( ), -); \ No newline at end of file +); diff --git a/vendor/fguillot/picofeed/tests/Client/ClientTest.php b/vendor/fguillot/picofeed/tests/Client/ClientTest.php index 79592811b..b50837230 100644 --- a/vendor/fguillot/picofeed/tests/Client/ClientTest.php +++ b/vendor/fguillot/picofeed/tests/Client/ClientTest.php @@ -6,6 +6,9 @@ use PHPUnit_Framework_TestCase; class ClientTest extends PHPUnit_Framework_TestCase { + /** + * @group online + */ public function testDownload() { $client = Client::getInstance(); @@ -20,6 +23,7 @@ class ClientTest extends PHPUnit_Framework_TestCase /** * @runInSeparateProcess + * @group online */ public function testPassthrough() { @@ -31,6 +35,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->expectOutputString(file_get_contents('tests/fixtures/miniflux_favicon.ico')); } + /** + * @group online + */ public function testCacheBothHaveToMatch() { $client = Client::getInstance(); @@ -46,6 +53,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertTrue($client->isModified()); } + /** + * @group online + */ public function testCacheEtag() { $client = Client::getInstance(); @@ -63,6 +73,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertFalse($client->isModified()); } + /** + * @group online + */ public function testCacheLastModified() { $client = Client::getInstance(); @@ -78,6 +91,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertFalse($client->isModified()); } + /** + * @group online + */ public function testCacheBoth() { $client = Client::getInstance(); @@ -95,6 +111,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertFalse($client->isModified()); } + /** + * @group online + */ public function testCharset() { $client = Client::getInstance(); @@ -108,6 +127,9 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertEquals('', $client->getEncoding()); } + /** + * @group online + */ public function testContentType() { $client = Client::getInstance(); diff --git a/vendor/fguillot/picofeed/tests/Client/CurlTest.php b/vendor/fguillot/picofeed/tests/Client/CurlTest.php index e141a1f54..3ee249ff3 100644 --- a/vendor/fguillot/picofeed/tests/Client/CurlTest.php +++ b/vendor/fguillot/picofeed/tests/Client/CurlTest.php @@ -6,6 +6,9 @@ use PHPUnit_Framework_TestCase; class CurlTest extends PHPUnit_Framework_TestCase { + /** + * @group online + */ public function testDownload() { $client = new Curl; @@ -20,6 +23,7 @@ class CurlTest extends PHPUnit_Framework_TestCase /** * @runInSeparateProcess + * @group online */ public function testPassthrough() { @@ -31,6 +35,9 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->expectOutputString(file_get_contents('tests/fixtures/miniflux_favicon.ico')); } + /** + * @group online + */ public function testRedirect() { $client = new Curl; @@ -46,6 +53,7 @@ class CurlTest extends PHPUnit_Framework_TestCase /** * @expectedException PicoFeed\Client\InvalidCertificateException + * @group online */ public function testSSL() { diff --git a/vendor/fguillot/picofeed/tests/Client/GrabberTest.php b/vendor/fguillot/picofeed/tests/Client/GrabberTest.php index 8fc9c58a6..224dc14f1 100644 --- a/vendor/fguillot/picofeed/tests/Client/GrabberTest.php +++ b/vendor/fguillot/picofeed/tests/Client/GrabberTest.php @@ -7,6 +7,9 @@ use PicoFeed\Reader\Reader; class GrabberTest extends PHPUnit_Framework_TestCase { + /** + * @group online + */ public function testGrabContentWithCandidates() { $grabber = new Grabber('http://theonion.com.feedsportal.com/c/34529/f/632231/s/309a7fe4/sc/20/l/0L0Stheonion0N0Carticles0Cobama0Ethrows0Eup0Eright0Ethere0Eduring0Esyria0Emeeting0H336850C/story01.htm'); @@ -37,6 +40,9 @@ class GrabberTest extends PHPUnit_Framework_TestCase } // 01net.com - https://github.com/fguillot/miniflux/issues/267 + /** + * @group online + */ public function testGetRules_afterRedirection() { $grabber = new Grabber('http://rss.feedsportal.com/c/629/f/502199/s/422f8c8a/sc/44/l/0L0S0A1net0N0Ceditorial0C640A3130Cces0E20A150Eimprimer0Eune0Epizza0Eet0Edes0Ebiscuits0Evideo0C0T0Dxtor0FRSS0E16/story01.htm'); @@ -44,6 +50,9 @@ class GrabberTest extends PHPUnit_Framework_TestCase $this->assertTrue(is_array($grabber->getRules())); } + /** + * @group online + */ public function testGrabContent() { $grabber = new Grabber('http://www.egscomics.com/index.php?id=1690'); @@ -53,6 +62,9 @@ class GrabberTest extends PHPUnit_Framework_TestCase $this->assertEquals('', $grabber->getContent()); } + /** + * @group online + */ public function testRssGrabContent() { $reader = new Reader; diff --git a/vendor/fguillot/picofeed/tests/Client/StreamTest.php b/vendor/fguillot/picofeed/tests/Client/StreamTest.php index 314d488c3..9a72789a8 100644 --- a/vendor/fguillot/picofeed/tests/Client/StreamTest.php +++ b/vendor/fguillot/picofeed/tests/Client/StreamTest.php @@ -6,6 +6,9 @@ use PHPUnit_Framework_TestCase; class StreamTest extends PHPUnit_Framework_TestCase { + /** + * @group online + */ public function testChunkedResponse() { $client = new Stream; @@ -15,6 +18,9 @@ class StreamTest extends PHPUnit_Framework_TestCase $this->assertEquals('', substr($result['body'], -6)); } + /** + * @group online + */ public function testDownload() { $client = new Stream; @@ -29,6 +35,7 @@ class StreamTest extends PHPUnit_Framework_TestCase /** * @runInSeparateProcess + * @group online */ public function testPassthrough() { @@ -40,6 +47,9 @@ class StreamTest extends PHPUnit_Framework_TestCase $this->expectOutputString(file_get_contents('tests/fixtures/miniflux_favicon.ico')); } + /** + * @group online + */ public function testRedirect() { $client = new Stream; @@ -64,6 +74,9 @@ class StreamTest extends PHPUnit_Framework_TestCase $client->doRequest(); } + /** + * @group online + */ public function testDecodeGzip() { if (function_exists('gzdecode')) { diff --git a/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php b/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php index 0f8d73694..71ee74f28 100644 --- a/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php @@ -94,7 +94,7 @@ class Rss20ParserTest extends PHPUnit_Framework_TestCase $parser = new Rss20(file_get_contents('tests/fixtures/fulltextrss.xml')); $feed = $parser->execute(); - $this->assertEquals(new DateTime, $feed->getDate()); + $this->assertEquals(time(), $feed->getDate()->getTimestamp(), '', 1); } public function testFeedLanguage() diff --git a/vendor/fguillot/picofeed/tests/Parser/XmlParserTest.php b/vendor/fguillot/picofeed/tests/Parser/XmlParserTest.php index 38520ebfe..a849c58f2 100644 --- a/vendor/fguillot/picofeed/tests/Parser/XmlParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/XmlParserTest.php @@ -17,8 +17,68 @@ class XmlParserTest extends PHPUnit_Framework_TestCase public function testGetEncodingFromMetaTag() { - $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); - $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('windows-1251', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('utf-8', XmlParser::getEncodingFromMetaTag('')); + $this->assertEquals('iso-8859-1', XmlParser::getEncodingFromMetaTag('')); } public function testGetEncodingFromXmlTag() diff --git a/vendor/fguillot/picofeed/tests/Reader/FaviconTest.php b/vendor/fguillot/picofeed/tests/Reader/FaviconTest.php index 0652bc4af..81c9a04d6 100644 --- a/vendor/fguillot/picofeed/tests/Reader/FaviconTest.php +++ b/vendor/fguillot/picofeed/tests/Reader/FaviconTest.php @@ -77,6 +77,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertEquals(array(), $favicon->extract($html)); } + /** + * @group online + */ public function testExists() { $favicon = new Favicon; @@ -87,6 +90,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertFalse($favicon->exists('')); } + /** + * @group online + */ public function testFind_inMeta() { $favicon = new Favicon; @@ -123,6 +129,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertEmpty($favicon->getContent()); } + /** + * @group online + */ public function testFind_directLinkFirst() { $favicon = new Favicon; @@ -135,6 +144,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertNotEmpty($favicon->getContent()); } + /** + * @group online + */ public function testFind_fallsBackToExtract() { $favicon = new Favicon; @@ -146,6 +158,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertNotEmpty($favicon->getContent()); } + /** + * @group online + */ public function testDataUri() { $favicon = new Favicon; @@ -160,6 +175,9 @@ class FaviconTest extends PHPUnit_Framework_TestCase $this->assertEquals($expected, $favicon->getDataUri()); } + /** + * @group online + */ public function testDataUri_withBadContentType() { $favicon = new Favicon; diff --git a/vendor/fguillot/picofeed/tests/Reader/ReaderTest.php b/vendor/fguillot/picofeed/tests/Reader/ReaderTest.php index 1bd60ffee..821c6b9aa 100644 --- a/vendor/fguillot/picofeed/tests/Reader/ReaderTest.php +++ b/vendor/fguillot/picofeed/tests/Reader/ReaderTest.php @@ -15,6 +15,9 @@ class ReaderTest extends PHPUnit_Framework_TestCase $this->assertEquals('https://google.com', $reader->prependScheme('https://google.com')); } + /** + * @group online + */ public function testDownload_withHTTP() { $reader = new Reader; @@ -22,6 +25,9 @@ class ReaderTest extends PHPUnit_Framework_TestCase $this->assertNotEmpty($feed); } + /** + * @group online + */ public function testDownload_withHTTPS() { $reader = new Reader; @@ -29,6 +35,9 @@ class ReaderTest extends PHPUnit_Framework_TestCase $this->assertNotEmpty($feed); } + /** + * @group online + */ public function testDownload_withCache() { $reader = new Reader; @@ -210,6 +219,9 @@ class ReaderTest extends PHPUnit_Framework_TestCase $this->assertEquals(array(), $feeds); } + /** + * @group online + */ public function testDiscover() { $reader = new Reader; -- cgit v1.2.3