diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Entity/EntryTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Entity/EntryTest.php b/tests/Wallabag/CoreBundle/Entity/EntryTest.php new file mode 100644 index 00000000..d400636e --- /dev/null +++ b/tests/Wallabag/CoreBundle/Entity/EntryTest.php | |||
@@ -0,0 +1,28 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Tests\Wallabag\CoreBundle\Entity; | ||
4 | |||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Wallabag\CoreBundle\Entity\Entry; | ||
7 | |||
8 | class EntryTest extends WallabagCoreTestCase | ||
9 | { | ||
10 | public function testGetLanguage() | ||
11 | { | ||
12 | $this->logInAs('admin'); | ||
13 | $entry = new Entry($this->getLoggedInUser()); | ||
14 | $languages = [ | ||
15 | 'en_GB' => 'en-GB', | ||
16 | 'en_US' => 'en-US', | ||
17 | 'en-gb' => 'en-GB', | ||
18 | 'en-US' => 'en-US', | ||
19 | 'fr' => 'fr', | ||
20 | 'fr_FR' => 'fr-FR', | ||
21 | 'ja' => 'ja', | ||
22 | ]; | ||
23 | foreach ($languages as $entryLang => $lang) { | ||
24 | $entry->setLanguage($entryLang); | ||
25 | $this->assertSame($lang, $entry->getHTMLLanguage()); | ||
26 | } | ||
27 | } | ||
28 | } | ||