1 backdrop_web_test_case.php protected BackdropWebTestCase::assertNoResponse($code, $message = '')

Asserts the page did not return the specified response code.

Parameters

$code: Response code. For example 200 is a successful page request. For a list of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

$message: Message to display.

Return value

Assertion result.:

File

core/modules/simpletest/backdrop_web_test_case.php, line 3910

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

protected function assertNoResponse($code, $message = '') {
  $curl_code = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE);
  $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code;
  return $this->assertFalse($match, $message ? $message : t('HTTP response not expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)), t('Browser'));
}