class TestResponseAssert mixin Assert (View source)

internal  
 

Methods

withResponse(TestResponse $response)

Create a new TestResponse assertion helper.

mixed
__call($name, $arguments)

Pass method calls to the Assert class and decorate the exception message.

static mixed
__callStatic($name, $arguments)

Pass static method calls to the Assert class.

ExpectationFailedException
injectResponseContext(ExpectationFailedException $exception)

Inject additional context from the response into the exception message.

appendExceptionToException(Throwable $exceptionToAppend, Throwable $exception)

Append an exception to the message of another exception.

appendErrorsToException(array $errors, Throwable $exception, bool $json = false)

Append errors to an exception message.

appendMessageToException(string $message, Throwable $exception)

Append a message to an exception.

Details

static TestResponseAssert withResponse(TestResponse $response)

Create a new TestResponse assertion helper.

Parameters

TestResponse $response

Return Value

TestResponseAssert

mixed __call($name, $arguments)

Pass method calls to the Assert class and decorate the exception message.

Parameters

$name
$arguments

Return Value

mixed

static mixed __callStatic($name, $arguments)

Pass static method calls to the Assert class.

Parameters

$name
$arguments

Return Value

mixed

protected ExpectationFailedException injectResponseContext(ExpectationFailedException $exception)

Inject additional context from the response into the exception message.

Parameters

ExpectationFailedException $exception

Return Value

ExpectationFailedException

protected Throwable appendExceptionToException(Throwable $exceptionToAppend, Throwable $exception)

Append an exception to the message of another exception.

Parameters

Throwable $exceptionToAppend
Throwable $exception

Return Value

Throwable

protected Throwable appendErrorsToException(array $errors, Throwable $exception, bool $json = false)

Append errors to an exception message.

Parameters

array $errors
Throwable $exception
bool $json

Return Value

Throwable

protected Throwable appendMessageToException(string $message, Throwable $exception)

Append a message to an exception.

Parameters

string $message
Throwable $exception

Return Value

Throwable