public function LanguageAccessAdminTest::testUserForm in Language access 8
Test language access works on user admin screens.
File
- tests/
src/ Functional/ LanguageAccessAdminTest.php, line 114
Class
- LanguageAccessAdminTest
- Test language access on entity admin screens.
Namespace
Drupal\Tests\language_access\FunctionalCode
public function testUserForm() : void {
$this
->drupalLogin($this->userEn);
$this
->drupalGet('en/user/' . $this->userEn
->id() . '/edit');
$this
->assertSession()
->optionExists('preferred_langcode', 'en');
$this
->assertSession()
->optionNotExists('preferred_langcode', 'nl');
$this
->drupalLogin($this->userNl);
$this
->drupalGet('en/user/' . $this->userNl
->id() . '/edit');
$this
->assertSession()
->optionExists('preferred_langcode', 'nl');
$this
->assertSession()
->optionNotExists('preferred_langcode', 'en');
}