Merge branch '2.6' into 2.7
* 2.6: Update DateTimeToArrayTransformer.php Mock microtime() and time() in transient tests Azerbaijani language pluralization rule Move HHVM tests out of the allowed failures
This commit is contained in:
commit
4b9446edf8
|
@ -21,7 +21,6 @@ matrix:
|
||||||
- php: hhvm
|
- php: hhvm
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: nightly
|
- php: nightly
|
||||||
- php: hhvm
|
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
services: mongodb
|
services: mongodb
|
||||||
|
|
|
@ -179,15 +179,16 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$dateTime = new \DateTime(sprintf(
|
$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['year']) ? '1970' : $value['year'],
|
||||||
empty($value['month']) ? '1' : $value['month'],
|
empty($value['month']) ? '1' : $value['month'],
|
||||||
empty($value['day']) ? '1' : $value['day'],
|
empty($value['day']) ? '1' : $value['day'],
|
||||||
empty($value['hour']) ? '0' : $value['hour'],
|
empty($value['hour']) ? '0' : $value['hour'],
|
||||||
empty($value['minute']) ? '0' : $value['minute'],
|
empty($value['minute']) ? '0' : $value['minute'],
|
||||||
empty($value['second']) ? '0' : $value['second'],
|
empty($value['second']) ? '0' : $value['second']
|
||||||
$this->outputTimezone
|
),
|
||||||
));
|
new \DateTimeZone($this->outputTimezone)
|
||||||
|
);
|
||||||
|
|
||||||
if ($this->inputTimezone !== $this->outputTimezone) {
|
if ($this->inputTimezone !== $this->outputTimezone) {
|
||||||
$dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
|
$dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* 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'];
|
||||||
|
}
|
|
@ -13,6 +13,8 @@ namespace Symfony\Component\HttpFoundation\Tests;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Cookie;
|
use Symfony\Component\HttpFoundation\Cookie;
|
||||||
|
|
||||||
|
require_once __DIR__.'/ClockMock.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CookieTest.
|
* CookieTest.
|
||||||
*
|
*
|
||||||
|
|
|
@ -14,6 +14,8 @@ namespace Symfony\Component\HttpFoundation\Tests;
|
||||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||||
use Symfony\Component\HttpFoundation\Cookie;
|
use Symfony\Component\HttpFoundation\Cookie;
|
||||||
|
|
||||||
|
require_once __DIR__.'/ClockMock.php';
|
||||||
|
|
||||||
class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase
|
class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* 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);
|
||||||
|
}
|
|
@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests;
|
||||||
|
|
||||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||||
|
|
||||||
|
require_once __DIR__.'/ClockMock.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StopwatchEventTest.
|
* StopwatchEventTest.
|
||||||
*
|
*
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests;
|
||||||
|
|
||||||
use Symfony\Component\Stopwatch\Stopwatch;
|
use Symfony\Component\Stopwatch\Stopwatch;
|
||||||
|
|
||||||
|
require_once __DIR__.'/ClockMock.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StopwatchTest.
|
* StopwatchTest.
|
||||||
*
|
*
|
||||||
|
|
|
@ -55,6 +55,7 @@ class PluralizationRules
|
||||||
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||||
*/
|
*/
|
||||||
switch ($locale) {
|
switch ($locale) {
|
||||||
|
case 'az':
|
||||||
case 'bo':
|
case 'bo':
|
||||||
case 'dz':
|
case 'dz':
|
||||||
case 'id':
|
case 'id':
|
||||||
|
@ -73,7 +74,6 @@ class PluralizationRules
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'af':
|
case 'af':
|
||||||
case 'az':
|
|
||||||
case 'bn':
|
case 'bn':
|
||||||
case 'bg':
|
case 'bg':
|
||||||
case 'ca':
|
case 'ca':
|
||||||
|
|
Reference in New Issue