From 33a6e50c964107a4004c067fa62bd301d8d05876 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 28 Jan 2015 21:57:34 -0500 Subject: [PATCH] Add debug_mode config option and update vendor --- assets/css/app.css | 14 ++ common.php | 5 - config.default.php | 3 - controllers/config.php | 2 +- docs/config.markdown | 3 - locales/fr_FR/translations.php | 2 + models/config.php | 9 +- models/schema.php | 7 +- templates/config.php | 81 +++++---- templates/console.php | 2 +- templates/services.php | 32 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +- vendor/composer/installed.json | 83 ++++----- vendor/fguillot/picofeed/README.markdown | 1 + vendor/fguillot/picofeed/composer.json | 7 +- .../lib/PicoFeed/Encoding/Encoding.php | 162 +----------------- .../lib/PicoFeed/Rules/alainonline.net.php | 10 ++ .../picofeed/tests/Parser/DateParserTest.php | 20 +-- .../picofeed/tests/Parser/Rss20ParserTest.php | 6 +- .../picofeed/tests/Parser/Rss91ParserTest.php | 4 +- .../picofeed/tests/Parser/Rss92ParserTest.php | 2 +- 22 files changed, 179 insertions(+), 288 deletions(-) create mode 100644 vendor/fguillot/picofeed/lib/PicoFeed/Rules/alainonline.net.php diff --git a/assets/css/app.css b/assets/css/app.css index fc978e0..9054ead 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -759,6 +759,20 @@ iframe { color: #339966; } +#config-form { + border-left: none; + padding: 0; +} + +#config-form h3 { + border-bottom: 1px dotted #ccc; +} + +.options { + border-left: 3px dotted #eee; + padding-left: 20px; +} + /* desktop design */ @media only screen and (min-width: 480px) { diff --git a/common.php b/common.php index b194aab..0c13b30 100644 --- a/common.php +++ b/common.php @@ -16,7 +16,6 @@ defined('DATA_DIRECTORY') or define('DATA_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_S defined('ENABLE_MULTIPLE_DB') or define('ENABLE_MULTIPLE_DB', true); defined('DB_FILENAME') or define('DB_FILENAME', 'db.sqlite'); -defined('DEBUG') or define('DEBUG', true); defined('DEBUG_FILENAME') or define('DEBUG_FILENAME', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'debug.log'); defined('THEME_DIRECTORY') or define('THEME_DIRECTORY', 'themes'); @@ -34,10 +33,6 @@ defined('AUTO_UPDATE_BACKUP_DIRECTORY') or define('AUTO_UPDATE_BACKUP_DIRECTORY' require __DIR__.'/check_setup.php'; -if (DEBUG) { - PicoFeed\Logging\Logger::enable(); -} - PicoDb\Database::bootstrap('db', function() { $db = new PicoDb\Database(array( diff --git a/config.default.php b/config.default.php index e4bb9db..9f452bd 100644 --- a/config.default.php +++ b/config.default.php @@ -12,9 +12,6 @@ define('DB_FILENAME', 'db.sqlite'); // ENABLE_MULTIPLE_DB => default value is true (multiple users support) define('ENABLE_MULTIPLE_DB', true); -// DEBUG => default is true (enable logging of PicoFeed) -define('DEBUG', true); - // DEBUG_FILENAME => default is data/debug.log define('DEBUG_FILENAME', DATA_DIRECTORY.'/debug.log'); diff --git a/controllers/config.php b/controllers/config.php index 8477fe2..2fb8572 100644 --- a/controllers/config.php +++ b/controllers/config.php @@ -138,7 +138,7 @@ Router\get_action('config', function() { // Update preferences Router\post_action('config', function() { - $values = Request\values() + array('nocontent' => 0, 'image_proxy' => 0, 'favicons' => 0); + $values = Request\values() + array('nocontent' => 0, 'image_proxy' => 0, 'favicons' => 0, 'debug_mode' => 0); Model\Config\check_csrf_values($values); list($valid, $errors) = Model\Config\validate_modification($values); diff --git a/docs/config.markdown b/docs/config.markdown index 4835bc9..0c38863 100644 --- a/docs/config.markdown +++ b/docs/config.markdown @@ -26,9 +26,6 @@ define('DB_FILENAME', 'db.sqlite'); // ENABLE_MULTIPLE_DB => default value is true (multiple users support) define('ENABLE_MULTIPLE_DB', true); -// DEBUG => default is true (enable logging of PicoFeed) -define('DEBUG', true); - // DEBUG_FILENAME => default is data/debug.log define('DEBUG_FILENAME', DATA_DIRECTORY.'/debug.log'); diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php index 06965ce..9efc017 100644 --- a/locales/fr_FR/translations.php +++ b/locales/fr_FR/translations.php @@ -232,4 +232,6 @@ return array( 'general' => 'général', 'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Une erreur est survenue pendant la dernière vérification. Actualisez, le flux manuellement and vérifiez les erreurs dans la %sconsole%s !', 'Refresh interval in minutes for unread counter' => 'Fréquence d\'actualisation en minute du compteur de non lus', + 'Nothing to show. Enable the debug mode to see log messages.' => 'Rien à montrer. Activez le mode debug pour voir les messages de log.', + 'Enable debug mode' => 'Activer le mode debug', ); diff --git a/models/config.php b/models/config.php index 4108e75..c37dd39 100644 --- a/models/config.php +++ b/models/config.php @@ -36,6 +36,10 @@ function get_reader_config() $config->setFilterImageProxyUrl('?action=proxy&url=%s'); } + if ((bool) get('debug_mode')) { + Logger::enable(); + } + // Parser $config->setParserHashAlgo('crc32b'); @@ -64,7 +68,7 @@ function debug($line) // Write PicoFeed debug output to a file function write_debug() { - if (DEBUG) { + if ((bool) get('debug_mode')) { file_put_contents(DEBUG_FILENAME, implode(PHP_EOL, Logger::getMessages())); } } @@ -219,7 +223,7 @@ function check_csrf($token) function generate_token() { if (function_exists('openssl_random_pseudo_bytes')) { - return bin2hex(\openssl_random_pseudo_bytes(25)); + return bin2hex(openssl_random_pseudo_bytes(25)); } else if (ini_get('open_basedir') === '' && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { return hash('sha256', file_get_contents('/dev/urandom', false, null, 0, 30)); @@ -283,6 +287,7 @@ function validate_modification(array $values) new Validators\Integer('items_per_page', t('Must be an integer')), new Validators\Required('theme', t('Value required')), new Validators\Integer('frontend_updatecheck_interval', t('Must be an integer')), + new Validators\Integer('debug_mode', t('Must be an integer')), ); if (ENABLE_AUTO_UPDATE) { diff --git a/models/schema.php b/models/schema.php index 00d4351..e5223d4 100644 --- a/models/schema.php +++ b/models/schema.php @@ -5,7 +5,12 @@ namespace Schema; use PDO; use Model\Config; -const VERSION = 36; +const VERSION = 37; + +function version_37($pdo) +{ + $pdo->exec('INSERT INTO settings ("key", "value") VALUES ("debug_mode", 0)'); +} function version_36($pdo) { diff --git a/templates/config.php b/templates/config.php index f1b4c49..6744b26 100644 --- a/templates/config.php +++ b/templates/config.php @@ -12,62 +12,69 @@
-
+

- - -
+
+ + +
- -
+ +
- -
+ +
+

- -
+
+ +
- -
+ +
- -
+ +
- - -
- + + +

+ - -
+
+ + +
+

- -
+
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
-
- -
+
+
+
diff --git a/templates/console.php b/templates/console.php index c8cb7dd..93c3018 100644 --- a/templates/console.php +++ b/templates/console.php @@ -7,7 +7,7 @@
-

+

diff --git a/templates/services.php b/templates/services.php index f867ebb..fac4c13 100644 --- a/templates/services.php +++ b/templates/services.php @@ -13,29 +13,33 @@
- + -

+ +

+
+
-
+ +
- -
- - - + + +

-
+
+
- -
- - -
+ +
+ +
+
+
diff --git a/vendor/autoload.php b/vendor/autoload.php index 01b20b2..1126cb5 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da::getLoader(); +return ComposerAutoloaderInit5f8b99c769a3ccbc962bd7a5595128da::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 55cd67d..665e15a 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da +class ComposerAutoloaderInit5f8b99c769a3ccbc962bd7a5595128da { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit5f8b99c769a3ccbc962bd7a5595128da', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit5f8b99c769a3ccbc962bd7a5595128da', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ class ComposerAutoloaderInit489790cbd05fef7749a4adcb52f440da $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire489790cbd05fef7749a4adcb52f440da($file); + composerRequire5f8b99c769a3ccbc962bd7a5595128da($file); } return $loader; } } -function composerRequire489790cbd05fef7749a4adcb52f440da($file) +function composerRequire5f8b99c769a3ccbc962bd7a5595128da($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3fd2578..45e85ea 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -116,45 +116,6 @@ "description": "The most easy to use validator library for PHP :)", "homepage": "https://github.com/fguillot/simpleValidator" }, - { - "name": "fguillot/picofeed", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/fguillot/picoFeed.git", - "reference": "83e406cbfbd188dbfbc0330c0757b037a87b0928" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/83e406cbfbd188dbfbc0330c0757b037a87b0928", - "reference": "83e406cbfbd188dbfbc0330c0757b037a87b0928", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-01-28 01:01:28", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "PicoFeed": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Unlicense" - ], - "authors": [ - { - "name": "Frédéric Guillot", - "homepage": "http://fredericguillot.com" - } - ], - "description": "Modern library to write or read feeds (RSS/Atom)", - "homepage": "http://fguillot.github.io/picoFeed" - }, { "name": "fguillot/picodb", "version": "v0.0.2", @@ -193,5 +154,49 @@ ], "description": "Minimalist database query builder", "homepage": "https://github.com/fguillot/picoDb" + }, + { + "name": "fguillot/picofeed", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/fguillot/picoFeed.git", + "reference": "9253c3d5ff1148a5175bf24633b73725832437c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/9253c3d5ff1148a5175bf24633b73725832437c8", + "reference": "9253c3d5ff1148a5175bf24633b73725832437c8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "php": ">=5.3.0" + }, + "time": "2015-01-29 02:00:49", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "PicoFeed": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Unlicense" + ], + "authors": [ + { + "name": "Frédéric Guillot", + "homepage": "http://fredericguillot.com" + } + ], + "description": "Modern library to write or read feeds (RSS/Atom)", + "homepage": "http://fguillot.github.io/picoFeed" } ] diff --git a/vendor/fguillot/picofeed/README.markdown b/vendor/fguillot/picofeed/README.markdown index ea18adb..4a958c2 100644 --- a/vendor/fguillot/picofeed/README.markdown +++ b/vendor/fguillot/picofeed/README.markdown @@ -33,6 +33,7 @@ Requirements - libxml >= 2.7 - XML PHP extensions: DOM and SimpleXML - cURL or Stream Context (`allow_url_fopen=On`) +- iconv extension Authors ------- diff --git a/vendor/fguillot/picofeed/composer.json b/vendor/fguillot/picofeed/composer.json index bc842f3..be2e24e 100644 --- a/vendor/fguillot/picofeed/composer.json +++ b/vendor/fguillot/picofeed/composer.json @@ -11,7 +11,12 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "ext-iconv": "*", + "ext-dom": "*", + "ext-xml": "*", + "ext-libxml": "*", + "ext-SimpleXML": "*" }, "autoload": { "psr-0": {"PicoFeed": "lib/"} diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php b/vendor/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php index 0be017f..0ef80ad 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php @@ -2,167 +2,15 @@ namespace PicoFeed\Encoding; -/** - * @author "Sebastián Grignoli" - * @package Encoding - * @version 1.2 - * @link https://github.com/neitanod/forceutf8 - * @example https://github.com/neitanod/forceutf8 - * @license Revised BSD - */ class Encoding { - protected static $win1252ToUtf8 = array( - 128 => "\xe2\x82\xac", - 130 => "\xe2\x80\x9a", - 131 => "\xc6\x92", - 132 => "\xe2\x80\x9e", - 133 => "\xe2\x80\xa6", - 134 => "\xe2\x80\xa0", - 135 => "\xe2\x80\xa1", - 136 => "\xcb\x86", - 137 => "\xe2\x80\xb0", - 138 => "\xc5\xa0", - 139 => "\xe2\x80\xb9", - 140 => "\xc5\x92", - 142 => "\xc5\xbd", - 145 => "\xe2\x80\x98", - 146 => "\xe2\x80\x99", - 147 => "\xe2\x80\x9c", - 148 => "\xe2\x80\x9d", - 149 => "\xe2\x80\xa2", - 150 => "\xe2\x80\x93", - 151 => "\xe2\x80\x94", - 152 => "\xcb\x9c", - 153 => "\xe2\x84\xa2", - 154 => "\xc5\xa1", - 155 => "\xe2\x80\xba", - 156 => "\xc5\x93", - 158 => "\xc5\xbe", - 159 => "\xc5\xb8" - ); - - /** - * Function Encoding::toUTF8 - * - * This function leaves UTF8 characters alone, while converting almost all non-UTF8 to UTF8. - * - * It assumes that the encoding of the original string is either Windows-1252 or ISO 8859-1. - * - * It may fail to convert characters to UTF-8 if they fall into one of these scenarios: - * - * 1) when any of these characters: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß - * are followed by any of these: ("group B") - * ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶•¸¹º»¼½¾¿ - * For example: %ABREPRESENT%C9%BB. «REPRESENTÉ» - * The "«" (%AB) character will be converted, but the "É" followed by "»" (%C9%BB) - * is also a valid unicode character, and will be left unchanged. - * - * 2) when any of these: àáâãäåæçèéêëìíîï are followed by TWO chars from group B, - * 3) when any of these: ðñòó are followed by THREE chars from group B. - * - * @name toUTF8 - * @param string $text Any string. - * @return string The same string, UTF8 encoded - * - */ - public static function toUTF8($text) - { - if (is_array($text)) { - foreach ($text as $k => $v) { - $text[$k] = self::toUTF8($v); - } - - return $text; - } - elseif (is_string($text)) { - - $max = strlen($text); - $buf = ""; - - for ($i = 0; $i < $max; $i++) { - - $c1 = $text{$i}; - - if ($c1>="\xc0") { //Should be converted to UTF8, if it's not UTF8 already - - $c2 = $i+1 >= $max? "\x00" : $text{$i+1}; - $c3 = $i+2 >= $max? "\x00" : $text{$i+2}; - $c4 = $i+3 >= $max? "\x00" : $text{$i+3}; - - if ($c1 >= "\xc0" & $c1 <= "\xdf") { //looks like 2 bytes UTF8 - - if ($c2 >= "\x80" && $c2 <= "\xbf") { //yeah, almost sure it's UTF8 already - $buf .= $c1 . $c2; - $i++; - } - else { //not valid UTF8. Convert it. - $buf .= self::convertInvalidCharacter($c1); - } - } - else if ($c1 >= "\xe0" & $c1 <= "\xef") { //looks like 3 bytes UTF8 - - if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { //yeah, almost sure it's UTF8 already - $buf .= $c1 . $c2 . $c3; - $i = $i + 2; - } - else { //not valid UTF8. Convert it. - $buf .= self::convertInvalidCharacter($c1); - } - } - else if ($c1 >= "\xf0" & $c1 <= "\xf7") { //looks like 4 bytes UTF8 - - if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { //yeah, almost sure it's UTF8 already - $buf .= $c1 . $c2 . $c3; - $i = $i + 2; - } - else { //not valid UTF8. Convert it. - $buf .= self::convertInvalidCharacter($c1); - } - } - else { //doesn't look like UTF8, but should be converted - $buf .= self::convertInvalidCharacter($c1); - } - } - elseif (($c1 & "\xc0") == "\x80") { // needs conversion - - if (isset(self::$win1252ToUtf8[ord($c1)])) { //found in Windows-1252 special cases - $buf .= self::$win1252ToUtf8[ord($c1)]; - } - else { - $buf .= self::convertInvalidCharacter($c1); - } - } - else { // it doesn't need conversion - $buf .= $c1; - } - } - - return $buf; - } - else { - return $text; - } - } - - public static function convertInvalidCharacter($c1) - { - $cc1 = chr(ord($c1) / 64) | "\xc0"; - $cc2 = ($c1 & "\x3f") | "\x80"; - return $cc1.$cc2; - } - public static function convert($input, $encoding) { - switch ($encoding) { - case 'utf-8': - return $input; - case 'windows-1251': - case 'windows-1255': - case 'windows-1256': - return iconv($encoding, 'UTF-8//TRANSLIT', $input); - default: - return self::toUTF8($input); + if ($encoding === 'utf-8' || $encoding === '') { + return $input; } + + // convert input to utf-8; ignore malformed characters + return iconv($encoding, 'UTF-8//IGNORE', $input); } } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/alainonline.net.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/alainonline.net.php new file mode 100644 index 0000000..bbe26af --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/alainonline.net.php @@ -0,0 +1,10 @@ + 'http://www.alainonline.net/news_details.php?lang=arabic&sid=18907', + 'body' => array( + '//div[@class="news_details"]' + ), + 'strip' => array( + '//div[@class="news_details"]/div/div[last()]', + ), +); diff --git a/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php b/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php index df648ce..2f8a41d 100644 --- a/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php @@ -32,17 +32,17 @@ class DateParserTest extends PHPUnit_Framework_TestCase $this->assertEquals('2010-08-20', date('Y-m-d', $parser->getTimestamp('2010-08-20Thh:08:ssZ'))); $this->assertEquals(1288648057, $parser->getTimestamp('Mon, 01 Nov 2010 21:47:37 UT')); $this->assertEquals(1346069615, $parser->getTimestamp('Mon Aug 27 2012 12:13:35 GMT-0700 (PDT)')); - $this->assertEquals(time(), $parser->getTimestamp('Tue, 3 Febuary 2010 00:00:00 IST')); - $this->assertEquals(time(), $parser->getTimestamp('############# EST')); - $this->assertEquals(time(), $parser->getTimestamp('Wed, 30 Nov -0001 00:00:00 +0000')); - $this->assertEquals(time(), $parser->getTimestamp('čet, 24 maj 2012 00:00:00')); - $this->assertEquals(time(), $parser->getTimestamp('-0-0T::Z')); - $this->assertEquals(time(), $parser->getTimestamp('Wed, 18 2012')); - $this->assertEquals(time(), $parser->getTimestamp("'2009-09-30 CDT16:09:54")); - $this->assertEquals(time(), $parser->getTimestamp('ary 8 Jan 2013 00:00:00 GMT')); - $this->assertEquals(time(), $parser->getTimestamp('Sat, 11 00:00:01 GMT')); + $this->assertEquals(time(), $parser->getTimestamp('Tue, 3 Febuary 2010 00:00:00 IST'), 1); + $this->assertEquals(time(), $parser->getTimestamp('############# EST'), 1); + $this->assertEquals(time(), $parser->getTimestamp('Wed, 30 Nov -0001 00:00:00 +0000'), 1); + $this->assertEquals(time(), $parser->getTimestamp('čet, 24 maj 2012 00:00:00'), 1); + $this->assertEquals(time(), $parser->getTimestamp('-0-0T::Z'), 1); + $this->assertEquals(time(), $parser->getTimestamp('Wed, 18 2012'), 1); + $this->assertEquals(time(), $parser->getTimestamp("'2009-09-30 CDT16:09:54"), 1); + $this->assertEquals(time(), $parser->getTimestamp('ary 8 Jan 2013 00:00:00 GMT'), 1); + $this->assertEquals(time(), $parser->getTimestamp('Sat, 11 00:00:01 GMT'), 1); $this->assertEquals(1370631743, $parser->getTimestamp('Fri Jun 07 2013 19:02:23 GMT+0000 (UTC)')); $this->assertEquals(1377412225, $parser->getTimestamp('25/08/2013 06:30:25 م')); - $this->assertEquals(time(), $parser->getTimestamp('+0400')); + $this->assertEquals(time(), $parser->getTimestamp('+0400'),1); } } diff --git a/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php b/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php index c282ad3..1850e63 100644 --- a/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/Rss20ParserTest.php @@ -93,7 +93,7 @@ class Rss20ParserTest extends PHPUnit_Framework_TestCase $parser = new Rss20(file_get_contents('tests/fixtures/fulltextrss.xml')); $feed = $parser->execute(); - $this->assertEquals(time(), $feed->getDate()); + $this->assertEquals(time(), $feed->getDate(), 1); } public function testFeedLanguage() @@ -259,9 +259,5 @@ class Rss20ParserTest extends PHPUnit_Framework_TestCase $parser = new Rss20(file_get_contents('tests/fixtures/jeux-linux.fr.xml')); $feed = $parser->execute(); $this->assertNotEmpty($feed->items); - - $parser = new Rss20(file_get_contents('tests/fixtures/cercle.psy.xml')); - $feed = $parser->execute(); - $this->assertNotEmpty($feed->items); } } diff --git a/vendor/fguillot/picofeed/tests/Parser/Rss91ParserTest.php b/vendor/fguillot/picofeed/tests/Parser/Rss91ParserTest.php index f84a0d0..31d8c3a 100644 --- a/vendor/fguillot/picofeed/tests/Parser/Rss91ParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/Rss91ParserTest.php @@ -18,13 +18,13 @@ class Rss91ParserTest extends PHPUnit_Framework_TestCase $this->assertEquals('', $feed->getFeedUrl()); $this->assertEquals('http://writetheweb.com/', $feed->getSiteUrl()); $this->assertEquals('http://writetheweb.com/', $feed->getId()); - $this->assertEquals(time(), $feed->getDate()); + $this->assertEquals(time(), $feed->getDate(), 1); $this->assertEquals(6, count($feed->items)); $this->assertEquals('Giving the world a pluggable Gnutella', $feed->items[0]->getTitle()); $this->assertEquals('http://writetheweb.com/read.php?item=24', $feed->items[0]->getUrl()); $this->assertEquals('085a9133a75542f878fa73ee2afbb6a2350b6c4fb125e6d8ca09478c47702111', $feed->items[0]->getId()); - $this->assertEquals(time(), $feed->items[0]->getDate()); + $this->assertEquals(time(), $feed->items[0]->getDate(), 1); $this->assertEquals('webmaster@writetheweb.com', $feed->items[0]->getAuthor()); $this->assertTrue(strpos($feed->items[1]->getContent(), '

After a period of dormancy') === 0); } diff --git a/vendor/fguillot/picofeed/tests/Parser/Rss92ParserTest.php b/vendor/fguillot/picofeed/tests/Parser/Rss92ParserTest.php index 521cd7b..cf33147 100644 --- a/vendor/fguillot/picofeed/tests/Parser/Rss92ParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/Rss92ParserTest.php @@ -18,7 +18,7 @@ class Rss92ParserTest extends PHPUnit_Framework_TestCase $this->assertEquals('', $feed->getFeedUrl()); $this->assertEquals('http://www.universfreebox.com/', $feed->getSiteUrl()); $this->assertEquals('http://www.universfreebox.com/', $feed->getId()); - $this->assertEquals(time(), $feed->date); + $this->assertEquals(time(), $feed->date, 1); $this->assertEquals(30, count($feed->items)); $this->assertEquals('Retour de Xavier Niel sur Twitter, « sans initiative privée, pas de révolution #Born2code »', $feed->items[0]->title);