class TestResponseAssert mixin Assert (View source)

internal  
 

Methods

withResponse(TestResponse $response)

Create a new TestResponse assertion helper.

void
__call(string $name, array $arguments)

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

static void
__callStatic(string $name, array $arguments)

Pass static method calls to the Assert class.

ExpectationFailedException
injectResponseContext(ExpectationFailedException $exception)

Inject additional context from the response into the exception message.

ExpectationFailedException
appendExceptionToException(Throwable $exceptionToAppend, ExpectationFailedException $exception)

Append an exception to the message of another exception.

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

Append errors to an exception message.

ExpectationFailedException
appendMessageToException(string $message, ExpectationFailedException $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

void __call(string $name, array $arguments)

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

Parameters

string $name
array $arguments

Return Value

void

Exceptions

ExpectationFailedException

static void __callStatic(string $name, array $arguments)

Pass static method calls to the Assert class.

Parameters

string $name
array $arguments

Return Value

void

Exceptions

ExpectationFailedException

protected ExpectationFailedException injectResponseContext(ExpectationFailedException $exception)

Inject additional context from the response into the exception message.

Parameters

ExpectationFailedException $exception

Return Value

ExpectationFailedException

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

Append an exception to the message of another exception.

Parameters

Throwable $exceptionToAppend
ExpectationFailedException $exception

Return Value

ExpectationFailedException

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

Append errors to an exception message.

Parameters

array $errors
ExpectationFailedException $exception
bool $json

Return Value

ExpectationFailedException

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

Append a message to an exception.

Parameters

string $message
ExpectationFailedException $exception

Return Value

ExpectationFailedException

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.