AllowedLanguagesUserFieldTest.php in Allowed Languages 8
File
tests/src/Kernel/AllowedLanguagesUserFieldTest.php
View source
<?php
namespace Drupal\Tests\allowed_languages\Kernel;
class AllowedLanguagesUserFieldTest extends AllowedLanguagesKernelTestBase {
public function testAllowedLanguagesFieldExists() {
$this
->assertTrue($this->user
->hasField('allowed_languages'));
}
public function testAllowedLanguageGetAllowedLanguagesForUser() {
$allowed_languages = allowed_languages_get_allowed_languages_for_user($this->user);
$this
->assertEquals($allowed_languages, [
'sv',
'en',
]);
}
public function testAllowedLanguagesGetLanguageOptions() {
$language_options = allowed_languages_get_language_options();
$this
->assertEquals($language_options, [
'sv' => 'Swedish',
'en' => 'English',
]);
}
}