You are here

public function BaseRedirectTest::testBaseRedirect in Redirect 403 to User Login 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/BaseRedirectTest.php \Drupal\Tests\r4032login\Functional\BaseRedirectTest::testBaseRedirect()

Test the base redirection behavior.

@dataProvider baseRedirectDataProvider

Parameters

string $path: Request path.

int $code: Response status code.

string $destination: Resulting URL.

Throws

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/BaseRedirectTest.php, line 33

Class

BaseRedirectTest
Test normal redirection from 403 to login page.

Namespace

Drupal\Tests\r4032login\Functional

Code

public function testBaseRedirect($path, $code, $destination) {
  $this
    ->drupalGet($path);
  $this
    ->assertSession()
    ->statusCodeEquals($code);
  $this
    ->assertSession()
    ->addressEquals($destination);
}