1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Use lang attribute

This commit is contained in:
Simounet 2019-01-11 21:09:49 +01:00
parent 7937ed0c20
commit 416d44d0ae
No known key found for this signature in database
GPG key ID: 77D3B7DC794EB770
5 changed files with 51 additions and 9 deletions

View file

@ -0,0 +1,28 @@
<?php
namespace Tests\Wallabag\CoreBundle\Entity;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class EntryTest extends WallabagCoreTestCase
{
public function testGetLanguage()
{
$this->logInAs('admin');
$entry = new Entry($this->getLoggedInUser());
$languages = [
'en_GB' => 'en-GB',
'en_US' => 'en-US',
'en-gb' => 'en-GB',
'en-US' => 'en-US',
'fr' => 'fr',
'fr_FR' => 'fr-FR',
'ja' => 'ja',
];
foreach ($languages as $entryLang => $lang) {
$entry->setLanguage($entryLang);
$this->assertSame($lang, $entry->getHTMLLanguage());
}
}
}