Scalr\Tests\Functional\Api\ApiTestCase::assertErrorMessageErrorEquals PHP Méthode

assertErrorMessageErrorEquals() public méthode

Asserts error message error
public assertErrorMessageErrorEquals ( string $expectedError, Scalr\Tests\Functional\Api\ApiTestResponse $response )
$expectedError string Expected error
$response Scalr\Tests\Functional\Api\ApiTestResponse Api response
    public function assertErrorMessageErrorEquals($expectedError, ApiTestResponse $response)
    {
        $body = $response->getBody();
        $this->assertNotEmpty($body);
        $this->assertObjectHasAttribute('errors', $body);
        $this->assertNotEmpty($body->errors);
        $error = reset($body->errors);
        $this->assertObjectHasAttribute('code', $error);
        $this->assertEquals($expectedError, $error->code);
    }