minor #22761 [Intl] Fix intl tests for PHP < 5.5.10 (ogizanagi)

This PR was merged into the 2.7 branch.

Discussion
----------

[Intl] Fix intl tests for PHP < 5.5.10

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

Should fix tests in upper branches (see https://github.com/symfony/symfony/pull/22760).

Commits
-------

fab0629206 [Intl] Fix intl tests for PHP < 5.5.10
This commit is contained in:
Fabien Potencier 2017-05-27 10:23:24 -07:00
commit 6f12757505

View File

@ -342,7 +342,7 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
/**
* @dataProvider formatTimezoneProvider
* @requires PHP 5.5
* @requires PHP 5.5.10
*/
public function testFormatTimezone($pattern, $timezone, $expected)
{
@ -459,15 +459,11 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
);
}
/**
* @requires PHP 5.5.10
*/
public function testFormatWithDateTimeZoneGmt()
{
if (PHP_VERSION_ID < 50500 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
$this->markTestSkipped('Only in PHP 5.5+ IntlDateFormatter allows to use DateTimeZone objects.');
}
if (PHP_VERSION_ID < 50510) {
$this->markTestSkipped('Before PHP 5.5.10 the GMT timezone used to be converted to UTC.');
}
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, new \DateTimeZone('GMT'), IntlDateFormatter::GREGORIAN, 'zzz');
$this->assertEquals('GMT', $formatter->format(0));