|
@@ 70-88 (lines=19) @@
|
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** @test */ |
| 70 |
|
public function it_get_a_language_from_the_translations(Compiler $compiler, Repository $config) |
| 71 |
|
{ |
| 72 |
|
$filePath = 'cached/file'; |
| 73 |
|
$translations = [ |
| 74 |
|
'it' => [ |
| 75 |
|
'categoryName' => 'translation', |
| 76 |
|
], |
| 77 |
|
]; |
| 78 |
|
|
| 79 |
|
$compiler->getFilePath()->shouldBeCalled() |
| 80 |
|
->willReturn($filePath); |
| 81 |
|
|
| 82 |
|
$config->get('notifynder.translations')->shouldBeCalled() |
| 83 |
|
->willReturn($translations); |
| 84 |
|
|
| 85 |
|
$compiler->cacheFile($translations)->shouldBeCalled(); |
| 86 |
|
|
| 87 |
|
$this->getLanguage('it')->shouldReturn($translations['it']); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
/** @test */ |
| 91 |
|
public function it__try_to_get_a_language_from_the_translations(Compiler $compiler, Repository $config) |
|
@@ 91-110 (lines=20) @@
|
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
/** @test */ |
| 91 |
|
public function it__try_to_get_a_language_from_the_translations(Compiler $compiler, Repository $config) |
| 92 |
|
{ |
| 93 |
|
$filePath = 'cached/file'; |
| 94 |
|
$translations = [ |
| 95 |
|
'it' => [ |
| 96 |
|
'categoryName' => 'translation', |
| 97 |
|
], |
| 98 |
|
]; |
| 99 |
|
|
| 100 |
|
$compiler->getFilePath()->shouldBeCalled() |
| 101 |
|
->willReturn($filePath); |
| 102 |
|
|
| 103 |
|
$config->get('notifynder.translations')->shouldBeCalled() |
| 104 |
|
->willReturn($translations); |
| 105 |
|
|
| 106 |
|
$compiler->cacheFile($translations)->shouldBeCalled(); |
| 107 |
|
|
| 108 |
|
$this->shouldThrow(NotificationLanguageNotFoundException::class) |
| 109 |
|
->during('getLanguage', ['en']); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
/** @test */ |
| 113 |
|
public function it_get_the_translations_from_never_cached_config_file(Compiler $compiler, Repository $config) |