Skip to content

Commit

Permalink
[Intl] Make tests pass after the ICU data update
Browse files Browse the repository at this point in the history
  • Loading branch information
jakzal committed Feb 27, 2017
1 parent 65faa10 commit d135e5c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
Expand Up @@ -24,7 +24,7 @@ protected function setUp()
parent::setUp();

// Since we test against "de_AT", we need the full implementation
IntlTestHelper::requireFullIntl($this);
IntlTestHelper::requireFullIntl($this, '57.1');

\Locale::setDefault('de_AT');

Expand Down
Expand Up @@ -228,7 +228,7 @@ public function testReverseTransform($to, $from, $locale)
public function testReverseTransformWithGrouping($to, $from, $locale)
{
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this, false);
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

\Locale::setDefault($locale);

Expand Down Expand Up @@ -377,7 +377,7 @@ public function testReverseTransformDoesNotRoundIfNoScale()
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
{
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this, false);
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

\Locale::setDefault('fr');
$transformer = new NumberToLocalizedStringTransformer(null, true);
Expand All @@ -397,7 +397,7 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
{
// Since we test against "de_AT", we need the full implementation
IntlTestHelper::requireFullIntl($this, false);
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

\Locale::setDefault('de_AT');

Expand All @@ -412,7 +412,7 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep()
{
// Since we test against "de_DE", we need the full implementation
IntlTestHelper::requireFullIntl($this, false);
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

\Locale::setDefault('de_DE');

Expand All @@ -436,7 +436,7 @@ public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupin
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
{
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this, false);
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

\Locale::setDefault('bg');
$transformer = new NumberToLocalizedStringTransformer(null, true);
Expand All @@ -455,6 +455,8 @@ public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
*/
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
{
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

$transformer = new NumberToLocalizedStringTransformer(null, true);

$transformer->reverseTransform('1,234,5');
Expand All @@ -465,6 +467,8 @@ public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
*/
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep()
{
IntlTestHelper::requireFullIntl($this, '4.8.1.1');

$transformer = new NumberToLocalizedStringTransformer(null, true);

$transformer->reverseTransform('1234,5');
Expand Down
Expand Up @@ -504,7 +504,7 @@ public function testMonthsOption()
public function testMonthsOptionShortFormat()
{
// we test against "de_AT", so we need the full implementation
IntlTestHelper::requireFullIntl($this);
IntlTestHelper::requireFullIntl($this, '57.1');

\Locale::setDefault('de_AT');

Expand Down
Expand Up @@ -83,16 +83,18 @@ public function formatCurrencyWithCurrencyStyleProvider()
*/
public function testFormatCurrencyWithCurrencyStyleCostaRicanColonsRounding($value, $currency, $symbol, $expected)
{
IntlTestHelper::requireIntl($this, '58.1');

$formatter = $this->getNumberFormatter('en', NumberFormatter::CURRENCY);
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
}

public function formatCurrencyWithCurrencyStyleCostaRicanColonsRoundingProvider()
{
return array(
array(100, 'CRC', 'CRC', '%s100'),
array(-100, 'CRC', 'CRC', '-%s100'),
array(1000.12, 'CRC', 'CRC', '%s1,000'),
array(100, 'CRC', 'CRC', '%s100.00'),
array(-100, 'CRC', 'CRC', '-%s100.00'),
array(1000.12, 'CRC', 'CRC', '%s1,000.12'),
);
}

Expand Down
Expand Up @@ -34,7 +34,7 @@ public function testCreate()

public function testGetTextAttribute()
{
IntlTestHelper::requireFullIntl($this);
IntlTestHelper::requireFullIntl($this, '57.1');

parent::testGetTextAttribute();
}
Expand Down
Expand Up @@ -128,7 +128,7 @@ public function testInvalidComparisonToValue($dirtyValue, $dirtyValueAsString, $
// Conversion of dates to string differs between ICU versions
// Make sure we have the correct version loaded
if ($dirtyValue instanceof \DateTime || $dirtyValue instanceof \DateTimeInterface) {
IntlTestHelper::requireIntl($this);
IntlTestHelper::requireIntl($this, '57.1');

if (PHP_VERSION_ID < 50304 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
$this->markTestSkipped('Intl supports formatting DateTime objects since 5.3.4');
Expand Down
Expand Up @@ -287,7 +287,7 @@ public function testInvalidDatesMin($value, $dateTimeAsString)
{
// Conversion of dates to string differs between ICU versions
// Make sure we have the correct version loaded
IntlTestHelper::requireIntl($this);
IntlTestHelper::requireIntl($this, '57.1');

$constraint = new Range(array(
'min' => 'March 10, 2014',
Expand All @@ -310,7 +310,7 @@ public function testInvalidDatesMax($value, $dateTimeAsString)
{
// Conversion of dates to string differs between ICU versions
// Make sure we have the correct version loaded
IntlTestHelper::requireIntl($this);
IntlTestHelper::requireIntl($this, '57.1');

$constraint = new Range(array(
'max' => 'March 20, 2014',
Expand All @@ -333,7 +333,7 @@ public function testInvalidDatesCombinedMax($value, $dateTimeAsString)
{
// Conversion of dates to string differs between ICU versions
// Make sure we have the correct version loaded
IntlTestHelper::requireIntl($this);
IntlTestHelper::requireIntl($this, '57.1');

$constraint = new Range(array(
'min' => 'March 10, 2014',
Expand All @@ -358,7 +358,7 @@ public function testInvalidDatesCombinedMin($value, $dateTimeAsString)
{
// Conversion of dates to string differs between ICU versions
// Make sure we have the correct version loaded
IntlTestHelper::requireIntl($this);
IntlTestHelper::requireIntl($this, '57.1');

$constraint = new Range(array(
'min' => 'March 10, 2014',
Expand Down

0 comments on commit d135e5c

Please sign in to comment.