Scalr\Tests\Functional\Api\ApiTestCase::assertErrorMessageTextEquals PHP Метод

assertErrorMessageTextEquals() публичный Метод

Asserts error message text
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);
    }