TestSession
in package
Read only access to the session during testing.
Table of Contents
Properties
- $session : array<string|int, mixed>|null
Methods
- __construct() : mixed
- check() : bool
- Returns true if given variable name is set in session.
- read() : mixed
- Returns given session variable, or all of them, if no parameters given.
Properties
$session
protected
array<string|int, mixed>|null
$session
Methods
__construct()
public
__construct(array<string|int, mixed>|null $session) : mixed
Parameters
- $session : array<string|int, mixed>|null
-
Session data.
check()
Returns true if given variable name is set in session.
public
check([string|null $name = null ]) : bool
Parameters
- $name : string|null = null
-
Variable name to check for
Return values
bool —True if variable is there
read()
Returns given session variable, or all of them, if no parameters given.
public
read([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
-
The name of the session variable (or a path as sent to Hash.extract)
Return values
mixed —The value of the session variable, null if session not available, session not started, or provided name not found in the session.