You are here

public function LanguageAccessAdminTest::testBlockForm in Language access 8

Test language access works on content block admin screens.

File

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

Class

LanguageAccessAdminTest
Test language access on entity admin screens.

Namespace

Drupal\Tests\language_access\Functional

Code

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