Skip to content

Commit 48980b0

Browse files
committed
minor symfony#10955 Fixed test cases failing when the Intl extension is not installed (webmozart)
This PR was merged into the 2.3 branch. Discussion ---------- Fixed test cases failing when the Intl extension is not installed | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I tested the 2.3 branch against PHP 5.5.12 with the following ICU versions: * none * 4.0 * 4.2 * 4.4 * 4.6 * 4.8 * 49 * 50 * 51 * 52 * 53 This PR contains the related fixes. Commits ------- fad38e8 Fixed test cases failing when the Intl extension is not installed
2 parents 8850274 + fad38e8 commit 48980b0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Translation\Tests;
1313

14+
use Symfony\Component\Intl\Util\IntlTestHelper;
1415
use Symfony\Component\Translation\IdentityTranslator;
1516
use Symfony\Component\Translation\MessageSelector;
1617

@@ -59,6 +60,9 @@ public function testGetSetLocale()
5960

6061
public function testGetLocaleReturnsDefaultLocaleIfNotSet()
6162
{
63+
// in order to test with "pt_BR"
64+
IntlTestHelper::requireFullIntl($this);
65+
6266
$translator = new IdentityTranslator(new MessageSelector());
6367

6468
\Locale::setDefault('en');

src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ public function getInvalidCountries()
107107

108108
public function testValidateUsingCountrySpecificLocale()
109109
{
110+
// in order to test with "en_GB"
111+
IntlTestHelper::requireFullIntl($this);
112+
110113
\Locale::setDefault('en_GB');
114+
111115
$existingCountry = 'GB';
112116
$this->context->expects($this->never())
113117
->method('addViolation');

0 commit comments

Comments
 (0)