You are here

public function LanguageAccessAdminTest::testTaxonomyTermForm in Language access 8

Test language access works on taxonomy term admin screens.

File

tests/src/Functional/LanguageAccessAdminTest.php, line 93

Class

LanguageAccessAdminTest
Test language access on entity admin screens.

Namespace

Drupal\Tests\language_access\Functional

Code

public function testTaxonomyTermForm() : void {
  $this
    ->drupalLogin($this->userEn);
  $this
    ->drupalGet('en/admin/structure/taxonomy/manage/tags/add');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'en');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'und');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'zxx');
  $this
    ->assertSession()
    ->optionNotExists('langcode[0][value]', 'nl');
  $this
    ->drupalLogin($this->userNl);
  $this
    ->drupalGet('nl/admin/structure/taxonomy/manage/tags/add');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'nl');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'und');
  $this
    ->assertSession()
    ->optionExists('langcode[0][value]', 'zxx');
  $this
    ->assertSession()
    ->optionNotExists('langcode[0][value]', 'en');
}