You are here

public function LanguageAccessTest::testLanguageAccess in Language access 8

Test that the user does not have access to a disabled language.

File

tests/src/Functional/LanguageAccessTest.php, line 36

Class

LanguageAccessTest
Test language access on the frontend.

Namespace

Drupal\Tests\language_access\Functional

Code

public function testLanguageAccess() : void {
  $this
    ->drupalLogin($this->userEn);
  $this
    ->drupalGet('en/node/1');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('nl/node/1');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
}