AssertionsTrait

trait AssertionsTrait (View source)

Methods

void assertResponseOk()

Assert that the client response has an OK status code.

void assertResponseStatus(int $code)

Assert that the client response has a given code.

void assertViewHas(string|array $key, mixed $value = null)

Assert that the response view has a given piece of bound data.

void assertViewHasAll(array $bindings)

Assert that the view has a given list of bound data.

void assertViewMissing(string $key)

Assert that the response view is missing a piece of bound data.

void assertRedirectedTo(string $uri, array $with = [])

Assert whether the client was redirected to a given URI.

void assertRedirectedToRoute(string $name, array $parameters = [], array $with = [])

Assert whether the client was redirected to a given route.

void assertRedirectedToAction(string $name, array $parameters = [], array $with = [])

Assert whether the client was redirected to a given action.

void assertSessionHas(string|array $key, mixed $value = null)

Assert that the session has a given value.

void assertSessionHasAll(array $bindings)

Assert that the session has a given list of values.

void assertSessionHasErrors(string|array $bindings = [], mixed $format = null)

Assert that the session has errors bound.

void assertHasOldInput()

Assert that the session has old input.

Details

void assertResponseOk()

Assert that the client response has an OK status code.

Return Value

void

void assertResponseStatus(int $code)

Assert that the client response has a given code.

Parameters

int $code

Return Value

void

void assertViewHas(string|array $key, mixed $value = null)

Assert that the response view has a given piece of bound data.

Parameters

string|array $key
mixed $value

Return Value

void

void assertViewHasAll(array $bindings)

Assert that the view has a given list of bound data.

Parameters

array $bindings

Return Value

void

void assertViewMissing(string $key)

Assert that the response view is missing a piece of bound data.

Parameters

string $key

Return Value

void

void assertRedirectedTo(string $uri, array $with = [])

Assert whether the client was redirected to a given URI.

Parameters

string $uri
array $with

Return Value

void

void assertRedirectedToRoute(string $name, array $parameters = [], array $with = [])

Assert whether the client was redirected to a given route.

Parameters

string $name
array $parameters
array $with

Return Value

void

void assertRedirectedToAction(string $name, array $parameters = [], array $with = [])

Assert whether the client was redirected to a given action.

Parameters

string $name
array $parameters
array $with

Return Value

void

void assertSessionHas(string|array $key, mixed $value = null)

Assert that the session has a given value.

Parameters

string|array $key
mixed $value

Return Value

void

void assertSessionHasAll(array $bindings)

Assert that the session has a given list of values.

Parameters

array $bindings

Return Value

void

void assertSessionHasErrors(string|array $bindings = [], mixed $format = null)

Assert that the session has errors bound.

Parameters

string|array $bindings
mixed $format

Return Value

void

void assertHasOldInput()

Assert that the session has old input.

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Foundation/Testing/AssertionsTrait.html