77use Orisai \Localization \Formatting \SymfonyMessageFormatter ;
88use PHPUnit \Framework \TestCase ;
99use function date_default_timezone_set ;
10- use const PHP_OS ;
1110
1211/**
1312 * @runTestsInSeparateProcesses
1413 */
1514final class MessageFormatterTest extends TestCase
1615{
1716
18- private static IntlMessageFormatter $ intlFormatter ;
17+ private static IntlMessageFormatter $ formatter ;
1918
2019 private static SymfonyMessageFormatter $ symfonyFormatter ;
2120
2221 public static function setUpBeforeClass (): void
2322 {
2423 date_default_timezone_set ('UTC ' );
25- self ::$ intlFormatter = new IntlMessageFormatter ();
24+ self ::$ formatter = new IntlMessageFormatter ();
2625 self ::$ symfonyFormatter = new SymfonyMessageFormatter ();
2726 }
2827
@@ -40,8 +39,8 @@ public static function setUpBeforeClass(): void
4039 */
4140 public function testIntl (string $ locale , string $ message , array $ parameters , string $ expected ): void
4241 {
43- self ::assertSame ($ expected , self ::$ intlFormatter ->formatMessage ($ message , $ parameters , $ locale ));
44- self ::$ intlFormatter ->validatePattern ($ message , $ locale );
42+ self ::assertSame ($ expected , self ::$ formatter ->formatMessage ($ message , $ parameters , $ locale ));
43+ self ::$ formatter ->validatePattern ($ message , $ locale );
4544 }
4645
4746 /**
@@ -61,7 +60,7 @@ public function testIntl(string $locale, string $message, array $parameters, str
6160 public function testSymfony (string $ locale , string $ message , array $ parameters , string $ expected ): void
6261 {
6362 self ::assertSame ($ expected , self ::$ symfonyFormatter ->formatMessage ($ message , $ parameters , $ locale ));
64- self ::$ intlFormatter ->validatePattern ($ message , $ locale );
63+ self ::$ symfonyFormatter ->validatePattern ($ message , $ locale );
6564 }
6665
6766 /**
@@ -100,12 +99,7 @@ public function provideDuration(): Generator
10099 public function provideSpellout (): Generator
101100 {
102101 yield ['en-US ' , 'I have {0, spellout} apples ' , [34 ], 'I have thirty-four apples ' ];
103-
104- if (PHP_OS === 'Darwin ' ) {
105- yield ['ar ' , 'لدي {0, spellout} تفاحة ' , [34 ], 'لدي أربعة وثلاثون تفاحة ' ];
106- } else {
107- yield ['ar ' , 'لدي {0, spellout} تفاحة ' , [34 ], 'لدي أربعة و ثلاثون تفاحة ' ];
108- }
102+ yield ['ar ' , 'لدي {0, spellout} تفاحة ' , [34 ], 'لدي أربعة وثلاثون تفاحة ' ];
109103 }
110104
111105 /**
0 commit comments