You are here

public function LanguageAccessTest::testExcludedPages in Language access 8

Test that access is still allowed to excluded pages like the user pages.

File

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

Class

LanguageAccessTest
Test language access on the frontend.

Namespace

Drupal\Tests\language_access\Functional

Code

public function testExcludedPages() : void {
  $this
    ->drupalLogin($this->userNl);
  $this
    ->drupalGet('en/user/' . $this->userNl
    ->id());
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('nl/user/' . $this->userNl
    ->id());
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // This is an unexisting file, so it will result in a 404 when this URL is
  // not blocked by the language_access module.
  $this
    ->drupalGet(PublicStream::basePath() . '/styles/large/test.png');
  $this
    ->assertSession()
    ->statusCodeEquals(404);
}