diff --git a/.travis.yml b/.travis.yml index f95db1ab3fbb3..dd261eb756799 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php php: - 5.4 - 5.5 + - 5.6 env: - TEST_SUITE=unit - TEST_SUITE=integration @@ -10,6 +11,10 @@ env: - TEST_SUITE=static_annotation matrix: exclude: + - php: 5.4 + env: TEST_SUITE=static_phpcs + - php: 5.4 + env: TEST_SUITE=static_annotation - php: 5.5 env: TEST_SUITE=static_phpcs - php: 5.5 @@ -18,22 +23,34 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix before_script: - # mock mail + # Mock mail - sudo service postfix stop - smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & - echo -e '#!/usr/bin/env bash\nexit 0' | sudo tee /usr/sbin/sendmail - - echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -i | grep "PHP Version" | head -n 1 | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" + - > + echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' + | sudo tee "/home/travis/.phpenv/versions/`php -i + | grep "PHP Version" + | head -n 1 + | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" # Disable xDebug - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - # Create DB for Integration tests - - sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then mysql -e 'create database magento_integration_tests;'; mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; fi" - # Install tools for static tests - - sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ] || [ '$TEST_SUITE' = 'static_annotation' ]; then pear install pear/PHP_CodeSniffer-1.5.2; fi" - # Change memmory_limit for travis server + # Install MySQL 5.6, create DB for integration tests + - > + sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then + sudo apt-get remove --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5; + sudo apt-get autoremove; + sudo apt-get autoclean; + sudo apt-add-repository ppa:ondrej/mysql-5.6 -y; + sudo apt-get update; + sudo apt-get install mysql-server-5.6 mysql-client-5.6; + mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_integration_tests;'; + mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; + fi" + # Change memory_limit for travis - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv rehash; - - composer install --no-interaction --prefer-source --dev - - cd .. + - composer install --no-interaction --dev script: # Unit tests - sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi" diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index c584342db5c8d..17d96968a6e92 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -182,7 +182,9 @@ public function getRegionJson() ]; } $json = $this->_coreHelper->jsonEncode($regions); - + if ($json === false) { + $json = 'false'; + } $this->_configCacheType->save($json, $cacheKey); } $this->_regionJson = $json; diff --git a/composer.json b/composer.json index 7d2f652018410..e45234c751e3b 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "zendframework/zend-stdlib": "2.3.1", "zendframework/zend-code": "2.3.1", "zendframework/zend-server": "2.3.1", diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index d1cf52c0ad8b6..f5bb55aa9639f 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -102,7 +102,8 @@ protected function _assignConfigData(\PHPUnit_Framework_TestCase $test) if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { /* Store-scoped config value */ $storeCode = $matches[0] != 'current' ? $matches[0] : null; - list(, $configPath, $requiredValue) = preg_split('/\s+/', $configPathAndValue, 3); + $parts = preg_split('/\s+/', $configPathAndValue, 3); + list(, $configPath, $requiredValue) = $parts + ['', '', '']; $originalValue = $this->_getConfigValue($configPath, $storeCode); $this->_storeConfigValues[$storeCode][$configPath] = $originalValue; $this->_setConfigValue($configPath, $requiredValue, $storeCode);