diff --git a/.travis.yml b/.travis.yml index b7ce58bd8f..e01ab63ab3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -dist: precise +dist: trusty sudo: false git: @@ -13,17 +13,14 @@ addons: env: global: - - MIN_PHP=5.3.9 + - MIN_PHP=5.4.9 - SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/versions/5.6/bin/php matrix: include: - # Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version - php: hhvm-3.18 sudo: required - dist: trusty group: edge - - php: 5.3 - php: 5.4 - php: 5.5 - php: 5.6 @@ -99,7 +96,6 @@ before_install: echo opcache.enable_cli = 1 >> $INI echo hhvm.jit = 0 >> $INI echo apc.enable_cli = 1 >> $INI - echo extension = ldap.so >> $INI [[ $PHP = 5.* ]] && echo extension = memcache.so >> $INI if [[ $PHP = 5.* ]]; then echo extension = mongo.so >> $INI diff --git a/appveyor.yml b/appveyor.yml index ae43082f82..6d86996726 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,8 +17,8 @@ init: install: - mkdir c:\php && cd c:\php - appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/cacert.pem - - appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-5.3.11-nts-Win32-VC9-x86.zip - - 7z x php-5.3.11-nts-Win32-VC9-x86.zip -y >nul + - appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-5.3.9-nts-Win32-VC9-x86.zip + - 7z x php-5.3.9-nts-Win32-VC9-x86.zip -y >nul - appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/ICU-51.2-dlls.zip - 7z x ICU-51.2-dlls.zip -y >nul - appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.1.3-Win32-VC14-x86.zip @@ -61,7 +61,7 @@ test_script: - cd c:\php && 7z x php-7.1.3-Win32-VC14-x86.zip -y >nul && copy /Y php.ini-min php.ini - cd c:\projects\symfony - php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel! - - cd c:\php && 7z x php-5.3.11-nts-Win32-VC9-x86.zip -y >nul && copy /Y php.ini-min php.ini + - cd c:\php && 7z x php-5.3.9-nts-Win32-VC9-x86.zip -y >nul && copy /Y php.ini-min php.ini - cd c:\projects\symfony - SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped - php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel! diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index 6d6073f7f0..69091f5269 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -23,20 +23,20 @@ "symfony/http-kernel": "~2.7" }, "require-dev": { - "symfony/browser-kit": "~2.4", + "symfony/browser-kit": "~2.7", "symfony/console": "~2.7", - "symfony/css-selector": "^2.0.5", - "symfony/dependency-injection": "^2.6.6", - "symfony/dom-crawler": "^2.0.5", + "symfony/css-selector": "^2.7", + "symfony/dependency-injection": "^2.7", + "symfony/dom-crawler": "^2.7", "symfony/form": "~2.7.15|^2.8.8", "symfony/framework-bundle": "~2.7.25|^2.8.18", "symfony/http-foundation": "~2.7", "symfony/twig-bundle": "~2.7", "symfony/twig-bridge": "^2.7.4", - "symfony/process": "^2.0.5", - "symfony/validator": "~2.5", - "symfony/yaml": "^2.0.5", - "symfony/expression-language": "~2.6", + "symfony/process": "^2.7", + "symfony/validator": "~2.7", + "symfony/yaml": "^2.7", + "symfony/expression-language": "~2.7", "doctrine/doctrine-bundle": "~1.2", "twig/twig": "~1.34|~2.4", "ircmaxell/password-compat": "~1.0" diff --git a/src/Symfony/Component/HttpFoundation/JsonResponse.php b/src/Symfony/Component/HttpFoundation/JsonResponse.php index c6e0ba6541..621c8410c2 100644 --- a/src/Symfony/Component/HttpFoundation/JsonResponse.php +++ b/src/Symfony/Component/HttpFoundation/JsonResponse.php @@ -121,7 +121,7 @@ class JsonResponse extends Response $data = json_encode($data, $this->encodingOptions); } else { try { - if (\PHP_VERSION_ID < 50400) { + if (!interface_exists('JsonSerializable', false)) { // PHP 5.3 triggers annoying warnings for some // types that can't be serialized as JSON (INF, resources, etc.) // but doesn't provide the JsonSerializable interface. @@ -153,7 +153,7 @@ class JsonResponse extends Response if (\PHP_VERSION_ID < 50500) { restore_error_handler(); } - if (\PHP_VERSION_ID >= 50400 && 'Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) { + if (interface_exists('JsonSerializable', false) && 'Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) { throw $e->getPrevious() ?: $e; } throw $e; diff --git a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 8156da0693..e15505cc69 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -206,10 +206,13 @@ class JsonResponseTest extends TestCase /** * @expectedException \Exception * @expectedExceptionMessage This error is expected - * @requires PHP 5.4 */ public function testSetContentJsonSerializeError() { + if (!interface_exists('JsonSerializable', false)) { + $this->markTestSkipped('JsonSerializable is required.'); + } + $serializable = new JsonSerializableObject(); JsonResponse::create($serializable); @@ -224,7 +227,7 @@ class JsonResponseTest extends TestCase } } -if (interface_exists('JsonSerializable')) { +if (interface_exists('JsonSerializable', false)) { class JsonSerializableObject implements \JsonSerializable { public function jsonSerialize()