You are here

public function QueryParametersToURLUnitTestCase::testQueryParameterValuesDecoding in Query Parameters To URL 7

Tests if an encoded query parameter's values is properly decoded.

File

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

Class

QueryParametersToURLUnitTestCase
Class QueryParametersToURLUnitTestCase.

Code

public function testQueryParameterValuesDecoding() {
  $test_cases = $this
    ->getTestCases();
  foreach ($test_cases as $test_case) {
    list($expected_parameter_values, $encoded_parameter_string) = $this
      ->unpackTestCase($test_case);
    $decoded_query_parameter_values = query_parameters_to_url_decode_query_parameter_values($encoded_parameter_string);
    $message = 'Query parameter values are decoded properly.<br/> Initial string:<br/>!initial<br/>Decoded to array:<br/>!array';
    $message = format_string($message, array(
      '!initial' => var_export($encoded_parameter_string, TRUE),
      '!array' => var_export($decoded_query_parameter_values, TRUE),
    ));
    $this
      ->assertEqual($decoded_query_parameter_values, $expected_parameter_values, $message);
  }
}