aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2020-01-28 10:06:30 +0100
committerGitHub <noreply@github.com>2020-01-28 10:06:30 +0100
commit8afcb3a6478325959c872fccf206bf8dc80d164c (patch)
treee2d97a8b979ac0eac67a200600cdd9ece2113a61 /tests
parent97c6561d5ce3c963ab77a0afd7a9164b2af56c20 (diff)
parent416d44d0aef68b04aec90d207e33feb68706e1c3 (diff)
downloadwallabag-8afcb3a6478325959c872fccf206bf8dc80d164c.tar.gz
wallabag-8afcb3a6478325959c872fccf206bf8dc80d164c.tar.zst
wallabag-8afcb3a6478325959c872fccf206bf8dc80d164c.zip
Merge pull request #4257 from Simounet/feat/lang-attribute
Use lang attribute
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Entity/EntryTest.php28
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
3namespace Tests\Wallabag\CoreBundle\Entity;
4
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Wallabag\CoreBundle\Entity\Entry;
7
8class 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}