Merge branch '2.7' into 2.8

* 2.7:
  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:
Nicolas Grekas 2015-07-01 20:24:26 +02:00
commit f59a0baa95
9 changed files with 77 additions and 6 deletions

View File

@ -21,7 +21,6 @@ matrix:
- php: hhvm
allow_failures:
- php: nightly
- php: hhvm
fast_finish: true
services: mongodb

View File

@ -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));

View File

@ -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'];
}

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\HttpFoundation\Tests;
use Symfony\Component\HttpFoundation\Cookie;
require_once __DIR__.'/ClockMock.php';
/**
* CookieTest.
*

View File

@ -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
{
/**

View File

@ -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);
}

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests;
use Symfony\Component\Stopwatch\StopwatchEvent;
require_once __DIR__.'/ClockMock.php';
/**
* StopwatchEventTest.
*

View File

@ -13,6 +13,8 @@ namespace Symfony\Component\Stopwatch\Tests;
use Symfony\Component\Stopwatch\Stopwatch;
require_once __DIR__.'/ClockMock.php';
/**
* StopwatchTest.
*

View File

@ -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':