Skip to content

Commit 6af36f1

Browse files
committed
Added integration test for Localization::getLanguages method
1 parent be36b4e commit 6af36f1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Integration/Service/LocalizationTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace App\Tests\Integration\Service;
1010

11+
use App\Enum\Language;
1112
use App\Service\Localization;
1213
use Exception;
1314
use PHPUnit\Framework\Attributes\TestDox;
@@ -22,6 +23,20 @@
2223
*/
2324
class LocalizationTest extends KernelTestCase
2425
{
26+
public function testThatGetLanguagesReturnsExpected(): void
27+
{
28+
$cache = $this->getMockBuilder(CacheInterface::class)->getMock();
29+
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
30+
$requestStack = new RequestStack();
31+
32+
$expected = Language::getValues();
33+
34+
self::assertSame(
35+
$expected,
36+
(new Localization($cache, $logger, $requestStack))->getLanguages(),
37+
);
38+
}
39+
2540
#[TestDox('Test that `LoggerInterface::error` method is called when `CacheInterface` throws an exception')]
2641
public function testThatLoggerIsCalledWhenCacheThrowsAnException(): void
2742
{

0 commit comments

Comments
 (0)