Skip to content

Commit 10e5313

Browse files
committed
Fix CI by adding a minimum version of ICU
This is a missing config inside the test suite not specifying the ICU version used result in a default required version that is too high for most systems (including last ubuntu versions and our CI!)
1 parent 0b36405 commit 10e5313

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

tests/Form/Type/PhoneNumberTypeTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use libphonenumber\PhoneNumberFormat;
1717
use libphonenumber\PhoneNumberUtil;
1818
use Misd\PhoneNumberBundle\Form\Type\PhoneNumberType;
19+
use Misd\PhoneNumberBundle\Tests\PhoneNumberSuiteConfig;
1920
use PHPUnit\Framework\TestCase;
2021
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
2122
use Symfony\Component\Form\FormFactoryInterface;
@@ -136,7 +137,7 @@ public function countryChoiceValuesProvider(): iterable
136137
*/
137138
public function testCountryChoiceChoices(array $choices, int $expectedChoicesCount, array $expectedChoices): void
138139
{
139-
IntlTestHelper::requireIntl($this);
140+
IntlTestHelper::requireIntl($this, PhoneNumberSuiteConfig::ICU_MINIMUM_VERSION);
140141

141142
$form = $this->factory->create(
142143
PhoneNumberType::class,
@@ -258,7 +259,7 @@ public function countryChoiceFormatProvider(): iterable
258259
*/
259260
public function testCountryChoicePlaceholder(?string $placeholder, ?string $expectedPlaceholder): void
260261
{
261-
IntlTestHelper::requireIntl($this);
262+
IntlTestHelper::requireIntl($this, PhoneNumberSuiteConfig::ICU_MINIMUM_VERSION);
262263
$form = $this->factory->create(PhoneNumberType::class, null, [
263264
'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE,
264265
'country_placeholder' => $placeholder,
@@ -286,7 +287,7 @@ public function countryChoicePlaceholderProvider(): iterable
286287

287288
public function testCountryChoiceTranslations(): void
288289
{
289-
IntlTestHelper::requireFullIntl($this);
290+
IntlTestHelper::requireFullIntl($this, PhoneNumberSuiteConfig::ICU_MINIMUM_VERSION);
290291
\Locale::setDefault('fr');
291292

292293
$form = $this->factory->create(PhoneNumberType::class, null, [

tests/PhoneNumberSuiteConfig.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Misd\PhoneNumberBundle\Tests;
6+
7+
final class PhoneNumberSuiteConfig
8+
{
9+
public const ICU_MINIMUM_VERSION = '75';
10+
}

0 commit comments

Comments
 (0)