[Intl] Make tests pass after the ICU data update
This commit is contained in:
parent
65faa1043d
commit
d135e5cd2f
@ -24,7 +24,7 @@ class DateTimeToLocalizedStringTransformerTest extends DateTimeTestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Since we test against "de_AT", we need the full implementation
|
// Since we test against "de_AT", we need the full implementation
|
||||||
IntlTestHelper::requireFullIntl($this);
|
IntlTestHelper::requireFullIntl($this, '57.1');
|
||||||
|
|
||||||
\Locale::setDefault('de_AT');
|
\Locale::setDefault('de_AT');
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
public function testReverseTransformWithGrouping($to, $from, $locale)
|
public function testReverseTransformWithGrouping($to, $from, $locale)
|
||||||
{
|
{
|
||||||
// Since we test against other locales, we need the full implementation
|
// 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);
|
\Locale::setDefault($locale);
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
|
public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot()
|
||||||
{
|
{
|
||||||
// Since we test against other locales, we need the full implementation
|
// 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');
|
\Locale::setDefault('fr');
|
||||||
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
||||||
@ -397,7 +397,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
|
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
|
||||||
{
|
{
|
||||||
// Since we test against "de_AT", we need the full implementation
|
// 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');
|
\Locale::setDefault('de_AT');
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep()
|
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep()
|
||||||
{
|
{
|
||||||
// Since we test against "de_DE", we need the full implementation
|
// 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');
|
\Locale::setDefault('de_DE');
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
|
public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma()
|
||||||
{
|
{
|
||||||
// Since we test against other locales, we need the full implementation
|
// 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');
|
\Locale::setDefault('bg');
|
||||||
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
||||||
@ -455,6 +455,8 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
|
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma()
|
||||||
{
|
{
|
||||||
|
IntlTestHelper::requireFullIntl($this, '4.8.1.1');
|
||||||
|
|
||||||
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
||||||
|
|
||||||
$transformer->reverseTransform('1,234,5');
|
$transformer->reverseTransform('1,234,5');
|
||||||
@ -465,6 +467,8 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep()
|
public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsCommaWithNoGroupSep()
|
||||||
{
|
{
|
||||||
|
IntlTestHelper::requireFullIntl($this, '4.8.1.1');
|
||||||
|
|
||||||
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
$transformer = new NumberToLocalizedStringTransformer(null, true);
|
||||||
|
|
||||||
$transformer->reverseTransform('1234,5');
|
$transformer->reverseTransform('1234,5');
|
||||||
|
@ -504,7 +504,7 @@ class DateTypeTest extends TestCase
|
|||||||
public function testMonthsOptionShortFormat()
|
public function testMonthsOptionShortFormat()
|
||||||
{
|
{
|
||||||
// we test against "de_AT", so we need the full implementation
|
// we test against "de_AT", so we need the full implementation
|
||||||
IntlTestHelper::requireFullIntl($this);
|
IntlTestHelper::requireFullIntl($this, '57.1');
|
||||||
|
|
||||||
\Locale::setDefault('de_AT');
|
\Locale::setDefault('de_AT');
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ abstract class AbstractNumberFormatterTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFormatCurrencyWithCurrencyStyleCostaRicanColonsRounding($value, $currency, $symbol, $expected)
|
public function testFormatCurrencyWithCurrencyStyleCostaRicanColonsRounding($value, $currency, $symbol, $expected)
|
||||||
{
|
{
|
||||||
|
IntlTestHelper::requireIntl($this, '58.1');
|
||||||
|
|
||||||
$formatter = $this->getNumberFormatter('en', NumberFormatter::CURRENCY);
|
$formatter = $this->getNumberFormatter('en', NumberFormatter::CURRENCY);
|
||||||
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
|
$this->assertEquals(sprintf($expected, $symbol), $formatter->formatCurrency($value, $currency));
|
||||||
}
|
}
|
||||||
@ -90,9 +92,9 @@ abstract class AbstractNumberFormatterTest extends TestCase
|
|||||||
public function formatCurrencyWithCurrencyStyleCostaRicanColonsRoundingProvider()
|
public function formatCurrencyWithCurrencyStyleCostaRicanColonsRoundingProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(100, 'CRC', 'CRC', '%s100'),
|
array(100, 'CRC', 'CRC', '%s100.00'),
|
||||||
array(-100, 'CRC', 'CRC', '-%s100'),
|
array(-100, 'CRC', 'CRC', '-%s100.00'),
|
||||||
array(1000.12, 'CRC', 'CRC', '%s1,000'),
|
array(1000.12, 'CRC', 'CRC', '%s1,000.12'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class NumberFormatterTest extends AbstractNumberFormatterTest
|
|||||||
|
|
||||||
public function testGetTextAttribute()
|
public function testGetTextAttribute()
|
||||||
{
|
{
|
||||||
IntlTestHelper::requireFullIntl($this);
|
IntlTestHelper::requireFullIntl($this, '57.1');
|
||||||
|
|
||||||
parent::testGetTextAttribute();
|
parent::testGetTextAttribute();
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal
|
|||||||
// Conversion of dates to string differs between ICU versions
|
// Conversion of dates to string differs between ICU versions
|
||||||
// Make sure we have the correct version loaded
|
// Make sure we have the correct version loaded
|
||||||
if ($dirtyValue instanceof \DateTime || $dirtyValue instanceof \DateTimeInterface) {
|
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'))) {
|
if (PHP_VERSION_ID < 50304 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
|
||||||
$this->markTestSkipped('Intl supports formatting DateTime objects since 5.3.4');
|
$this->markTestSkipped('Intl supports formatting DateTime objects since 5.3.4');
|
||||||
|
@ -287,7 +287,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
{
|
{
|
||||||
// Conversion of dates to string differs between ICU versions
|
// Conversion of dates to string differs between ICU versions
|
||||||
// Make sure we have the correct version loaded
|
// Make sure we have the correct version loaded
|
||||||
IntlTestHelper::requireIntl($this);
|
IntlTestHelper::requireIntl($this, '57.1');
|
||||||
|
|
||||||
$constraint = new Range(array(
|
$constraint = new Range(array(
|
||||||
'min' => 'March 10, 2014',
|
'min' => 'March 10, 2014',
|
||||||
@ -310,7 +310,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
{
|
{
|
||||||
// Conversion of dates to string differs between ICU versions
|
// Conversion of dates to string differs between ICU versions
|
||||||
// Make sure we have the correct version loaded
|
// Make sure we have the correct version loaded
|
||||||
IntlTestHelper::requireIntl($this);
|
IntlTestHelper::requireIntl($this, '57.1');
|
||||||
|
|
||||||
$constraint = new Range(array(
|
$constraint = new Range(array(
|
||||||
'max' => 'March 20, 2014',
|
'max' => 'March 20, 2014',
|
||||||
@ -333,7 +333,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
{
|
{
|
||||||
// Conversion of dates to string differs between ICU versions
|
// Conversion of dates to string differs between ICU versions
|
||||||
// Make sure we have the correct version loaded
|
// Make sure we have the correct version loaded
|
||||||
IntlTestHelper::requireIntl($this);
|
IntlTestHelper::requireIntl($this, '57.1');
|
||||||
|
|
||||||
$constraint = new Range(array(
|
$constraint = new Range(array(
|
||||||
'min' => 'March 10, 2014',
|
'min' => 'March 10, 2014',
|
||||||
@ -358,7 +358,7 @@ class RangeValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
{
|
{
|
||||||
// Conversion of dates to string differs between ICU versions
|
// Conversion of dates to string differs between ICU versions
|
||||||
// Make sure we have the correct version loaded
|
// Make sure we have the correct version loaded
|
||||||
IntlTestHelper::requireIntl($this);
|
IntlTestHelper::requireIntl($this, '57.1');
|
||||||
|
|
||||||
$constraint = new Range(array(
|
$constraint = new Range(array(
|
||||||
'min' => 'March 10, 2014',
|
'min' => 'March 10, 2014',
|
||||||
|
Reference in New Issue
Block a user