You are here

public function PreserveQueryStringTest::testPreserveQueryString in Redirect 403 to User Login 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/PreserveQueryStringTest.php \Drupal\Tests\r4032login\Functional\PreserveQueryStringTest::testPreserveQueryString()

Tests query string preservation.

@dataProvider preserveQueryStringDataProvider

Parameters

string $path: Request path.

array $options: Request options.

int $code: Response status code.

string $destination: Resulting URL.

Throws

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/PreserveQueryStringTest.php, line 40

Class

PreserveQueryStringTest
Test that query string is preserved after redirection.

Namespace

Drupal\Tests\r4032login\Functional

Code

public function testPreserveQueryString($path, array $options, $code, $destination) {
  $this
    ->drupalGet($path, $options);
  $this
    ->assertSession()
    ->statusCodeEquals($code);
  $currentUrl = str_replace($this->baseUrl . '/', '', $this
    ->getUrl());
  $this
    ->assertEquals($currentUrl, $destination);
}