Skip to content

Commit f59a0ba

Browse files
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
2 parents 734fdbe + 4b9446e commit f59a0ba

File tree

9 files changed

+77
-6
lines changed

9 files changed

+77
-6
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ matrix:
2121
- php: hhvm
2222
allow_failures:
2323
- php: nightly
24-
- php: hhvm
2524
fast_finish: true
2625

2726
services: mongodb

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,16 @@ public function reverseTransform($value)
179179

180180
try {
181181
$dateTime = new \DateTime(sprintf(
182-
'%s-%s-%s %s:%s:%s %s',
182+
'%s-%s-%s %s:%s:%s',
183183
empty($value['year']) ? '1970' : $value['year'],
184184
empty($value['month']) ? '1' : $value['month'],
185185
empty($value['day']) ? '1' : $value['day'],
186186
empty($value['hour']) ? '0' : $value['hour'],
187187
empty($value['minute']) ? '0' : $value['minute'],
188-
empty($value['second']) ? '0' : $value['second'],
189-
$this->outputTimezone
190-
));
188+
empty($value['second']) ? '0' : $value['second']
189+
),
190+
new \DateTimeZone($this->outputTimezone)
191+
);
191192

192193
if ($this->inputTimezone !== $this->outputTimezone) {
193194
$dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\HttpFoundation;
13+
14+
function time($asFloat = false)
15+
{
16+
return Tests\time();
17+
}
18+
19+
namespace Symfony\Component\HttpFoundation\Tests;
20+
21+
function time()
22+
{
23+
return $_SERVER['REQUEST_TIME'];
24+
}

src/Symfony/Component/HttpFoundation/Tests/CookieTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Component\HttpFoundation\Cookie;
1515

16+
require_once __DIR__.'/ClockMock.php';
17+
1618
/**
1719
* CookieTest.
1820
*

src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
1515
use Symfony\Component\HttpFoundation\Cookie;
1616

17+
require_once __DIR__.'/ClockMock.php';
18+
1719
class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase
1820
{
1921
/**
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Stopwatch;
13+
14+
function microtime($asFloat = false)
15+
{
16+
return Tests\microtime($asFloat);
17+
}
18+
19+
namespace Symfony\Component\Stopwatch\Tests;
20+
21+
function usleep($us)
22+
{
23+
static $now;
24+
25+
if (null === $now) {
26+
$now = \microtime(true);
27+
}
28+
29+
return $now += $us / 1000000;
30+
}
31+
32+
function microtime($asFloat = false)
33+
{
34+
if (!$asFloat) {
35+
return \microtime(false);
36+
}
37+
38+
return usleep(1);
39+
}

src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Component\Stopwatch\StopwatchEvent;
1515

16+
require_once __DIR__.'/ClockMock.php';
17+
1618
/**
1719
* StopwatchEventTest.
1820
*

src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Component\Stopwatch\Stopwatch;
1515

16+
require_once __DIR__.'/ClockMock.php';
17+
1618
/**
1719
* StopwatchTest.
1820
*

src/Symfony/Component/Translation/PluralizationRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public static function get($number, $locale)
5555
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
5656
*/
5757
switch ($locale) {
58+
case 'az':
5859
case 'bo':
5960
case 'dz':
6061
case 'id':
@@ -73,7 +74,6 @@ public static function get($number, $locale)
7374
break;
7475

7576
case 'af':
76-
case 'az':
7777
case 'bn':
7878
case 'bg':
7979
case 'ca':

0 commit comments

Comments
 (0)