diff --git a/.travis.yml b/.travis.yml index 95dbc421be..8ed9858691 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ matrix: - php: hhvm allow_failures: - php: nightly - - php: hhvm fast_finish: true services: mongodb diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php index afbfc1041e..07070952f5 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php @@ -179,15 +179,16 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer try { $dateTime = new \DateTime(sprintf( - '%s-%s-%s %s:%s:%s %s', + '%s-%s-%s %s:%s:%s', empty($value['year']) ? '1970' : $value['year'], empty($value['month']) ? '1' : $value['month'], empty($value['day']) ? '1' : $value['day'], empty($value['hour']) ? '0' : $value['hour'], empty($value['minute']) ? '0' : $value['minute'], - empty($value['second']) ? '0' : $value['second'], - $this->outputTimezone - )); + empty($value['second']) ? '0' : $value['second'] + ), + new \DateTimeZone($this->outputTimezone) + ); if ($this->inputTimezone !== $this->outputTimezone) { $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone)); diff --git a/src/Symfony/Component/HttpFoundation/Tests/ClockMock.php b/src/Symfony/Component/HttpFoundation/Tests/ClockMock.php new file mode 100644 index 0000000000..04a842d9b5 --- /dev/null +++ b/src/Symfony/Component/HttpFoundation/Tests/ClockMock.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +function time($asFloat = false) +{ + return Tests\time(); +} + +namespace Symfony\Component\HttpFoundation\Tests; + +function time() +{ + return $_SERVER['REQUEST_TIME']; +} diff --git a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php index 0aaeb6baa1..b8474db15f 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php @@ -13,6 +13,8 @@ namespace Symfony\Component\HttpFoundation\Tests; use Symfony\Component\HttpFoundation\Cookie; +require_once __DIR__.'/ClockMock.php'; + /** * CookieTest. * diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php index d5596f746c..0fa198e098 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php @@ -14,6 +14,8 @@ namespace Symfony\Component\HttpFoundation\Tests; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\Cookie; +require_once __DIR__.'/ClockMock.php'; + class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase { /** diff --git a/src/Symfony/Component/Stopwatch/Tests/ClockMock.php b/src/Symfony/Component/Stopwatch/Tests/ClockMock.php new file mode 100644 index 0000000000..5bbe6b1db8 --- /dev/null +++ b/src/Symfony/Component/Stopwatch/Tests/ClockMock.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Stopwatch; + +function microtime($asFloat = false) +{ + return Tests\microtime($asFloat); +} + +namespace Symfony\Component\Stopwatch\Tests; + +function usleep($us) +{ + static $now; + + if (null === $now) { + $now = \microtime(true); + } + + return $now += $us / 1000000; +} + +function microtime($asFloat = false) +{ + if (!$asFloat) { + return \microtime(false); + } + + return usleep(1); +} diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index c2626f67d8..4386d94fca 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests; use Symfony\Component\Stopwatch\StopwatchEvent; +require_once __DIR__.'/ClockMock.php'; + /** * StopwatchEventTest. * diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php index a14b6e80ea..0d05e8f800 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests; use Symfony\Component\Stopwatch\Stopwatch; +require_once __DIR__.'/ClockMock.php'; + /** * StopwatchTest. * diff --git a/src/Symfony/Component/Translation/PluralizationRules.php b/src/Symfony/Component/Translation/PluralizationRules.php index e1eac82ce9..3ef8f00b6e 100644 --- a/src/Symfony/Component/Translation/PluralizationRules.php +++ b/src/Symfony/Component/Translation/PluralizationRules.php @@ -55,6 +55,7 @@ class PluralizationRules * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) */ switch ($locale) { + case 'az': case 'bo': case 'dz': case 'id': @@ -73,7 +74,6 @@ class PluralizationRules break; case 'af': - case 'az': case 'bn': case 'bg': case 'ca':