1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2024-12-18 13:46:28 +00:00
wallabag/tests/Wallabag/CoreBundle/Entity/EntryTest.php

29 lines
749 B
PHP
Raw Normal View History

2019-01-11 20:09:49 +00:00
<?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());
}
}
}