laravel / 5.3.30 / api / 5.3 / illuminate / foundation / testing / concerns / interactswithsession.html /

InteractsWithSession

trait InteractsWithSession (View source)

Methods

$this withSession(array $data)

Set the session to the given array.

$this session(array $data)

Set the session to the given array.

$this startSession()

Start the session for the application.

$this flushSession()

Flush all of the current session data.

$this seeInSession(string|array $key, mixed $value = null)

Assert that the session has a given value.

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

Assert that the session has a given value.

$this assertSessionHasAll(array $bindings)

Assert that the session has a given list of values.

$this assertSessionMissing(string|array $key)

Assert that the session does not have a given key.

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

Assert that the session has errors bound.

$this assertHasOldInput()

Assert that the session has old input.

Details

$this withSession(array $data)

Set the session to the given array.

Parameters

array $data

Return Value

$this

$this session(array $data)

Set the session to the given array.

Parameters

array $data

Return Value

$this

protected $this startSession()

Start the session for the application.

Return Value

$this

$this flushSession()

Flush all of the current session data.

Return Value

$this

$this seeInSession(string|array $key, mixed $value = null)

Assert that the session has a given value.

Parameters

string|array $key
mixed $value

Return Value

$this

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

Assert that the session has a given value.

Parameters

string|array $key
mixed $value

Return Value

$this

$this assertSessionHasAll(array $bindings)

Assert that the session has a given list of values.

Parameters

array $bindings

Return Value

$this

$this assertSessionMissing(string|array $key)

Assert that the session does not have a given key.

Parameters

string|array $key

Return Value

$this

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

Assert that the session has errors bound.

Parameters

string|array $bindings
mixed $format

Return Value

$this

$this assertHasOldInput()

Assert that the session has old input.

Return Value

$this

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