[Locale] Fixed tests

This commit is contained in:
Martin Hasoň 2012-08-10 14:19:33 +02:00
parent 237629ad64
commit fc1e844bed
3 changed files with 12 additions and 1 deletions

View File

@ -13,6 +13,7 @@
>
<php>
<ini name="intl.default_locale" value="en"/>
<ini name="intl.error_level" value="0"/>
</php>
<testsuites>

View File

@ -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(

View File

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