1.20.x common.test public CommonBackdropHTTPResponseStatusLineTest::testStatusLine()

Tests parsing HTTP response status line.

File

modules/simpletest/tests/common.test, line 1155
Tests for common.inc functionality.

Class

CommonBackdropHTTPResponseStatusLineTest
Tests parsing of the HTTP response status line.

Code

public function testStatusLine() {
  // Grab the big array of test data from statusLineData().
  $data = $this->statusLineData();
  foreach ($data as $test_case) {
    $test_data = array_shift($test_case);
    $expected = array_shift($test_case);

    $outcome = _backdrop_parse_response_status($test_data);

    foreach (array_keys($expected) as $key) {
      $this->assertIdentical($outcome[$key], $expected[$key]);
    }
  }
}