[Intl] Make tests pass after the ICU data update

This commit is contained in:
Jakub Zalas 2017-02-27 19:38:27 +00:00
parent 65faa1043d
commit d135e5cd2f
No known key found for this signature in database
GPG Key ID: 15614199651BDE8D
7 changed files with 22 additions and 16 deletions

View File

@ -24,7 +24,7 @@ class DateTimeToLocalizedStringTransformerTest extends DateTimeTestCase
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');

View File

@ -228,7 +228,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
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);
@ -377,7 +377,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
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);
@ -397,7 +397,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
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');
@ -412,7 +412,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
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');
@ -436,7 +436,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
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);
@ -455,6 +455,8 @@ class NumberToLocalizedStringTransformerTest extends TestCase
*/
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
{
IntlTestHelper::requireFullIntl($this, '4.8.1.1');
$transformer = new NumberToLocalizedStringTransformer(null, true);
$transformer->reverseTransform('1,234,5');
@ -465,6 +467,8 @@ class NumberToLocalizedStringTransformerTest extends TestCase
*/
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep()
{
IntlTestHelper::requireFullIntl($this, '4.8.1.1');
$transformer = new NumberToLocalizedStringTransformer(null, true);
$transformer->reverseTransform('1234,5');

View File

@ -504,7 +504,7 @@ class DateTypeTest extends TestCase
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');

View File

@ -83,6 +83,8 @@ abstract class AbstractNumberFormatterTest extends TestCase
*/
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));
}
@ -90,9 +92,9 @@ abstract class AbstractNumberFormatterTest extends TestCase
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'),
);
}

View File

@ -34,7 +34,7 @@ class NumberFormatterTest extends AbstractNumberFormatterTest
public function testGetTextAttribute()
{
IntlTestHelper::requireFullIntl($this);
IntlTestHelper::requireFullIntl($this, '57.1');
parent::testGetTextAttribute();
}

View File

@ -128,7 +128,7 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal
// 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');

View File

@ -287,7 +287,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
{
// 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',
@ -310,7 +310,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
{
// 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',
@ -333,7 +333,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
{
// 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',
@ -358,7 +358,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
{
// 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',