wallabag/tests/Entity/EntryTest.php

29 lines
716 B
PHP
Raw Normal View History

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