| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class LocaleTest extends BaseTest |
||
| 20 | { |
||
| 21 | public function testRenderEn(): void |
||
| 22 | { |
||
| 23 | $app = $this->makeApp(); |
||
| 24 | |||
| 25 | $out = $app->get(ViewsInterface::class)->render('custom:locale'); |
||
| 26 | $this->assertSame('Hello English!', $out); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function testRenderRu(): void |
||
| 30 | { |
||
| 31 | $app = $this->makeApp(); |
||
| 32 | |||
| 33 | $app->get(TranslatorInterface::class)->setLocale('ru'); |
||
| 34 | |||
| 35 | $out = $app->get(ViewsInterface::class)->render('custom:locale'); |
||
| 36 | $this->assertSame('Hello Мир!', $out); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function testLocaleDependency(): void |
||
| 40 | { |
||
| 41 | $app = $this->makeApp(); |
||
| 42 | $d = $app->get(LocaleDependency::class); |
||
| 43 | |||
| 44 | $d = $d->__debugInfo(); |
||
| 45 | |||
| 46 | $this->assertSame('en', $d['value']); |
||
| 47 | |||
| 48 | $this->assertTrue(in_array('en', $d['variants'])); |
||
| 49 | $this->assertTrue(in_array('ru', $d['variants'])); |
||
| 50 | } |
||
| 52 |