Improved tests

This commit is contained in:
Nicolas Lœuillet 2016-03-18 13:12:09 +01:00
parent 78becd5401
commit 1b64a84b78
3 changed files with 18 additions and 7 deletions

View file

@ -257,7 +257,7 @@ class Config
/** /**
* Set readingSpeed. * Set readingSpeed.
* *
* @param int $readingSpeed * @param float $readingSpeed
* *
* @return Config * @return Config
*/ */
@ -271,7 +271,7 @@ class Config
/** /**
* Get readingSpeed. * Get readingSpeed.
* *
* @return int * @return float
*/ */
public function getReadingSpeed() public function getReadingSpeed()
{ {

View file

@ -46,6 +46,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$data = array( $data = array(
'config[theme]' => 'baggy', 'config[theme]' => 'baggy',
'config[items_per_page]' => '30', 'config[items_per_page]' => '30',
'config[reading_speed]' => '0.5',
'config[language]' => 'en', 'config[language]' => 'en',
); );

View file

@ -425,11 +425,13 @@ class SymfonyRequirements extends RequirementCollection
'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.' 'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
); );
$this->addPhpIniRequirement( if (version_compare($installedPhpVersion, '7.0.0', '<')) {
'date.timezone', true, false, $this->addPhpIniRequirement(
'date.timezone setting must be set', 'date.timezone', true, false,
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).' 'date.timezone setting must be set',
); 'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
}
if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
$timezones = array(); $timezones = array();
@ -677,6 +679,14 @@ class SymfonyRequirements extends RequirementCollection
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).' 'Upgrade your <strong>intl</strong> 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( $this->addPhpIniRecommendation(
'intl.error_level', 'intl.error_level',
create_function('$cfgValue', 'return (int) $cfgValue === 0;'), create_function('$cfgValue', 'return (int) $cfgValue === 0;'),