[Locale] Fixed tests
This commit is contained in:
parent
237629ad64
commit
fc1e844bed
|
@ -13,6 +13,7 @@
|
|||
>
|
||||
<php>
|
||||
<ini name="intl.default_locale" value="en"/>
|
||||
<ini name="intl.error_level" value="0"/>
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
|
|
|
@ -472,7 +472,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
|||
$this->skipIfIntlExtensionIsNotLoaded();
|
||||
$this->skipIfICUVersionIsTooOld();
|
||||
|
||||
$formatter = new \IntlDateFormatter('en', StubIntlDateFormatter::MEDIUM, StubIntlDateFormatter::SHORT);
|
||||
$formatter = new \IntlDateFormatter('en', StubIntlDateFormatter::MEDIUM, StubIntlDateFormatter::SHORT, 'UTC');
|
||||
$formatter->setPattern('yyyy-MM-dd HH:mm:ss');
|
||||
|
||||
$this->assertEquals(
|
||||
|
|
|
@ -160,6 +160,7 @@ class StubNumberFormatterTest extends LocaleTestCase
|
|||
*/
|
||||
public function testFormatCurrencyWithCurrencyStyleCostaRicanColonsRoundingStub($value, $currency, $symbol, $expected)
|
||||
{
|
||||
$this->skipIfICUDataVersionNotDefined();
|
||||
$formatter = $this->getStubFormatterWithCurrencyStyle();
|
||||
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
|
||||
}
|
||||
|
@ -191,6 +192,7 @@ class StubNumberFormatterTest extends LocaleTestCase
|
|||
*/
|
||||
public function testFormatCurrencyWithCurrencyStyleBrazilianRealRoundingStub($value, $currency, $symbol, $expected)
|
||||
{
|
||||
$this->skipIfICUDataVersionNotDefined();
|
||||
$formatter = $this->getStubFormatterWithCurrencyStyle();
|
||||
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
|
||||
}
|
||||
|
@ -231,6 +233,7 @@ class StubNumberFormatterTest extends LocaleTestCase
|
|||
*/
|
||||
public function testFormatCurrencyWithCurrencyStyleSwissRoundingStub($value, $currency, $symbol, $expected)
|
||||
{
|
||||
$this->skipIfICUDataVersionNotDefined();
|
||||
$formatter = $this->getStubFormatterWithCurrencyStyle();
|
||||
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
|
||||
}
|
||||
|
@ -1192,4 +1195,11 @@ class StubNumberFormatterTest extends LocaleTestCase
|
|||
|
||||
return $formatter;
|
||||
}
|
||||
|
||||
protected function skipIfICUDataVersionNotDefined()
|
||||
{
|
||||
if (!getenv('USE_INTL_ICU_DATA_VERSION')) {
|
||||
$this->markTestSkipped('Please set environment variable USE_INTL_ICU_DATA_VERSION.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue