You are here

public function QueryParametersToURLTestCase::testURLRewriting in Query Parameters To URL 7

Tests if inbound/outbound hooks do their job.

1 method overrides QueryParametersToURLTestCase::testURLRewriting()
QueryParametersToURLGlobalRedirectTestCase::testURLRewriting in ./query_parameters_to_url.test
Tests if inbound/outbound hooks do their job.

File

./query_parameters_to_url.test, line 102
Query Arguments To URL tests.

Class

QueryParametersToURLTestCase
General test cases.

Code

public function testURLRewriting() {
  $this
    ->pass('Test if urls are properly rewritten.');
  $test_cases = $this
    ->pathsToTest();
  foreach ($test_cases as $test_case) {
    list($path, $options, $expected_path) = $this
      ->unpackTestCase($test_case);

    // Make sure they are absolute URLs.
    $expected_path = $this
      ->createRawUrl($expected_path, array());

    // Make GET request and check the headers.
    $this
      ->drupalGet($path, $options);
    $headers = $this
      ->drupalGetHeaders(TRUE);
    $result = array(
      '!initial_path' => $path,
      '!expected_status' => '200',
      '!expected_path' => $expected_path,
      '!actual_path' => $this
        ->getUrl(),
      '!actual_status' => $headers[0][':status'],
    );
    $this
      ->assertStatusAndPath($result);
  }
}