Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
13 | public function testSimpleMessageFormatter(): void |
||
14 | { |
||
15 | $container = $this->createContainer(); |
||
16 | |||
17 | $customFormatter = new class () implements MessageFormatterInterface { |
||
18 | public function format(string $message, array $parameters, string $locale): string |
||
19 | { |
||
20 | return 'test'; |
||
21 | } |
||
22 | }; |
||
23 | |||
24 | /** @var CategorySource $translationCategorySource */ |
||
25 | $translationCategorySource = $container->get('[email protected]')[0]; |
||
26 | $message = '{n, selectordinal, one{#-one} two{#-two} few{#-few} other{#-other}}'; |
||
27 | |||
28 | // The default formatter argument is ignored in favor of formatter set in config. |
||
29 | $this->assertSame( |
||
30 | '1', |
||
31 | $translationCategorySource->format($message, ['n' => 1], 'en', $customFormatter), |
||
32 | ); |
||
35 |