function RestLoginHttpTest::assertHttpResponse
Same name and namespace in other branches
- 11.x core/modules/rest/tests/src/Functional/RestLoginHttpTest.php \Drupal\Tests\rest\Functional\RestLoginHttpTest::assertHttpResponse()
Checks a response for status code and body.
Parameters
\Psr\Http\Message\ResponseInterface $response: The response object.
int $expected_code: The expected status code.
string $expected_body: The expected response body.
File
-
core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php, line 342
Class
- RestLoginHttpTest
- Tests login and password reset via direct HTTP.
Namespace
Drupal\Tests\rest\FunctionalCode
protected function assertHttpResponse(ResponseInterface $response, int $expected_code, string $expected_body) : void {
$this->assertEquals($expected_code, $response->getStatusCode());
$this->assertEquals($expected_body, $response->getBody());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.