Class TestSession
Read only access to the session during testing.
        
    Namespace: Cake\TestSuite
    
    
    
      
  
      Property Summary
- 
        $session protected
array|null 
Method Summary
- 
          
__construct() public
 - 
          
check() public
Returns true if given variable name is set in session.
 - 
          
read() public
Returns given session variable, or all of them, if no parameters given.
 
Method Detail
__construct() ¶ public
__construct(array|null $session)
      Parameters
- 
                
array|null$session Session data.
check() ¶ public
check(string|null $name = null): bool
      Returns true if given variable name is set in session.
Parameters
- 
                
string|null$name optional Variable name to check for
Returns
boolTrue if variable is there
read() ¶ public
read(string|null $name = null): mixed
      Returns given session variable, or all of them, if no parameters given.
Parameters
- 
                
string|null$name optional The name of the session variable (or a path as sent to Hash.extract)
Returns
mixedThe value of the session variable, null if session not available, session not started, or provided name not found in the session.