diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-10-30 04:54:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 04:54:38 +0100 |
commit | 4c81fee548a25acfa543b8fc95d9505204f9974b (patch) | |
tree | 5d1082d1d69e27ccad08243968ef2a6c7b7a6399 /tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php | |
parent | d00d66a634498038de6d3536f434749070104b93 (diff) | |
parent | 8a298f0f5eedcf6520af58bdd3d5087b1fc39272 (diff) |
Merge pull request #667 from lujoga/translation
Fix some translation-related issues
Diffstat (limited to 'tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php')
-rw-r--r-- | tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php b/tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php index e55fdf02..8c9e21b8 100644 --- a/tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php +++ b/tests/Unit/Helpers/Translation/TranslationServiceProviderTest.php @@ -7,6 +7,7 @@ use Engelsystem\Helpers\Translation\TranslationServiceProvider; use Engelsystem\Helpers\Translation\Translator; use Engelsystem\Test\Unit\ServiceProviderTest; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Rule\InvokedCount; use Symfony\Component\HttpFoundation\Session\Session; class TranslationServiceProviderTest extends ServiceProviderTest @@ -82,11 +83,12 @@ class TranslationServiceProviderTest extends ServiceProviderTest $app = $this->getApp(['get']); $serviceProvider = new TranslationServiceProvider($app); - $this->setExpects($app, 'get', ['path.lang'], __DIR__ . '/Assets'); + $this->setExpects($app, 'get', ['path.lang'], __DIR__ . '/Assets', new InvokedCount(2)); // Get translator $translator = $serviceProvider->getTranslator('fo_OO'); $this->assertEquals('Foo Bar!', $translator->gettext('foo.bar')); + $this->assertEquals('Foo Bar required!', $translator->gettext('validation.foo.bar')); // Retry from cache $serviceProvider->getTranslator('fo_OO'); @@ -99,12 +101,13 @@ class TranslationServiceProviderTest extends ServiceProviderTest public function testGetTranslatorFromPo(): void { $app = $this->getApp(['get']); - $this->setExpects($app, 'get', ['path.lang'], __DIR__ . '/Assets'); + $this->setExpects($app, 'get', ['path.lang'], __DIR__ . '/Assets', new InvokedCount(2)); $serviceProvider = new TranslationServiceProvider($app); // Get translator using a .po file $translator = $serviceProvider->getTranslator('ba_RR'); $this->assertEquals('B Arr!', $translator->gettext('foo.bar')); + $this->assertEquals('B Arr required!', $translator->gettext('validation.foo.bar')); } } |