From 1b64a84b782090d8748bef0e9c390f491669e30c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Mar 2016 13:12:09 +0100 Subject: [PATCH] Improved tests --- src/Wallabag/CoreBundle/Entity/Config.php | 4 ++-- .../Tests/Controller/ConfigControllerTest.php | 1 + var/SymfonyRequirements.php | 20 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index e1a2090e..e18b543b 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -257,7 +257,7 @@ class Config /** * Set readingSpeed. * - * @param int $readingSpeed + * @param float $readingSpeed * * @return Config */ @@ -271,7 +271,7 @@ class Config /** * Get readingSpeed. * - * @return int + * @return float */ public function getReadingSpeed() { diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 2af93ffe..51425fe1 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php @@ -46,6 +46,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $data = array( 'config[theme]' => 'baggy', 'config[items_per_page]' => '30', + 'config[reading_speed]' => '0.5', 'config[language]' => 'en', ); diff --git a/var/SymfonyRequirements.php b/var/SymfonyRequirements.php index 28b0dcdb..841338f4 100644 --- a/var/SymfonyRequirements.php +++ b/var/SymfonyRequirements.php @@ -425,11 +425,13 @@ class SymfonyRequirements extends RequirementCollection 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' ); - $this->addPhpIniRequirement( - 'date.timezone', true, false, - 'date.timezone setting must be set', - 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' - ); + if (version_compare($installedPhpVersion, '7.0.0', '<')) { + $this->addPhpIniRequirement( + 'date.timezone', true, false, + 'date.timezone setting must be set', + 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' + ); + } if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { $timezones = array(); @@ -677,6 +679,14 @@ class SymfonyRequirements extends RequirementCollection 'Upgrade your intl extension with a newer ICU version (4+).' ); + if (class_exists('Symfony\Component\Intl\Intl')) { + $this->addRecommendation( + \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(), + sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), + 'In most cases you should be fine, but please verify there is no inconsistencies between data provided by Symfony and the intl extension. See https://github.com/symfony/symfony/issues/15007 for an example of inconsistencies you might run into.' + ); + } + $this->addPhpIniRecommendation( 'intl.error_level', create_function('$cfgValue', 'return (int) $cfgValue === 0;'), -- 2.41.0