public assertErrorMessageTextEquals ( string $expectedMessage, Scalr\Tests\Functional\Api\ApiTestResponse $response ) | ||
$expectedMessage | string | Expected message |
$response | Scalr\Tests\Functional\Api\ApiTestResponse | Api response |
public function assertErrorMessageTextEquals($expectedMessage, ApiTestResponse $response)
{
$body = $response->getBody();
$this->assertNotEmpty($body);
$this->assertObjectHasAttribute('errors', $body);
$this->assertNotEmpty($body->errors);
$error = reset($body->errors);
$this->assertObjectHasAttribute('message', $error);
$this->assertContains($expectedMessage, $error->message);
}