function RestLoginHttpTest::assertHttpResponseWithMessage
Same name and namespace in other branches
- 11.x core/modules/rest/tests/src/Functional/RestLoginHttpTest.php \Drupal\Tests\rest\Functional\RestLoginHttpTest::assertHttpResponseWithMessage()
Checks a response for status code and message.
Parameters
\Psr\Http\Message\ResponseInterface $response: The response object.
int $expected_code: The expected status code.
string $expected_message: The expected message encoded in response.
string $format: The format that the response is encoded in.
4 calls to RestLoginHttpTest::assertHttpResponseWithMessage()
- RestLoginHttpTest::doTestGlobalLoginFloodControl in core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php - Tests the global login flood control for a given serialization format.
- RestLoginHttpTest::doTestLogin in core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php - Do login testing for a given serialization format.
- RestLoginHttpTest::doTestPasswordReset in core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php - Do password reset testing for given format and account.
- RestLoginHttpTest::doTestPerUserLoginFloodControl in core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php - Tests the per-user login flood control for a given serialization format.
File
-
core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php, line 359
Class
- RestLoginHttpTest
- Tests login and password reset via direct HTTP.
Namespace
Drupal\Tests\rest\FunctionalCode
protected function assertHttpResponseWithMessage(ResponseInterface $response, int $expected_code, string $expected_message, string $format = 'json') : void {
$this->assertEquals($expected_code, $response->getStatusCode());
$this->assertEquals($expected_message, $this->getResultValue($response, 'message', $format));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.