You are here

public function LanguageAccessAdminTest::testNodeForm in Language access 8

Test language access works on node admin screens.

File

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

Class

LanguageAccessAdminTest
Test language access on entity admin screens.

Namespace

Drupal\Tests\language_access\Functional

Code

public function testNodeForm() : void {
  $this
    ->drupalLogin($this->userEn);
  $this
    ->drupalGet('en/node/add/page');
  $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/node/add/page');
  $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');
}