wallabag/tests/Entity/EntryTest.php

29 lines
708 B
PHP
Raw Permalink Normal View History

2019-01-11 20:09:49 +00:00
<?php
2024-02-19 00:30:12 +00:00
namespace Tests\Wallabag\Entity;
2019-01-11 20:09:49 +00:00
use Tests\Wallabag\WallabagTestCase;
2024-02-19 00:30:12 +00:00
use Wallabag\Entity\Entry;
2019-01-11 20:09:49 +00:00
class EntryTest extends WallabagTestCase
2019-01-11 20:09:49 +00:00
{
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());
}
}
}