From fad38e82f43abd985c08d08e8bbb3dd46350954e Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Wed, 21 May 2014 13:33:13 +0200 Subject: [PATCH] Fixed test cases failing when the Intl extension is not installed --- .../Component/Translation/Tests/IdentityTranslatorTest.php | 4 ++++ .../Validator/Tests/Constraints/CountryValidatorTest.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php index cec702a1b9..cfd282a294 100644 --- a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Translation\Tests; +use Symfony\Component\Intl\Util\IntlTestHelper; use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Translation\MessageSelector; @@ -59,6 +60,9 @@ class IdentityTranslatorTest extends \PHPUnit_Framework_TestCase public function testGetLocaleReturnsDefaultLocaleIfNotSet() { + // in order to test with "pt_BR" + IntlTestHelper::requireFullIntl($this); + $translator = new IdentityTranslator(new MessageSelector()); \Locale::setDefault('en'); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php index 95851e8097..5fabee67fb 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php @@ -107,7 +107,11 @@ class CountryValidatorTest extends \PHPUnit_Framework_TestCase public function testValidateUsingCountrySpecificLocale() { + // in order to test with "en_GB" + IntlTestHelper::requireFullIntl($this); + \Locale::setDefault('en_GB'); + $existingCountry = 'GB'; $this->context->expects($this->never()) ->method('addViolation');