Skip to content

Commit

Permalink
Add failing unit test for empty string locale
Browse files Browse the repository at this point in the history
Signed-off-by: Gediminas Kersys <[email protected]>
  • Loading branch information
kersysgediminas committed Sep 10, 2024
1 parent 9466a35 commit 0f7b0ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/Translator/TranslatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,17 @@ public function testNullMessageArgumentShouldReturnAnEmptyString(): void

self::assertEquals('', $this->translator->translate(null));
}

public function testTranslateWithEmptyStringLocale(): void
{
$this->translator->setLocale('en_US');
$this->translator->addTranslationFile(
'phparray',
$this->testFilesDir . '/testarray/translation-more-en_US.php',
'default',
'en_US'
);

self::assertEquals('Message 8 (en)', $this->translator->translate('Message 8', 'default', ''));

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.1, lowest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.1, latest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.2, lowest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.2, latest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.3, lowest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.

Check failure on line 563 in test/Translator/TranslatorTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPUnit [8.3, latest], ubuntu-latest, laminas/laminas-continuous-integration-action@v1...

Failed asserting that two strings are equal.
}
}

0 comments on commit 0f7b0ff

Please sign in to comment.