PHP Класс phpbb_session_testable_factory

The session class has rather complex dependencies, so in order to make its tests more * understandable and to make its dependencies more visible this factory class sets up all the necessary global state & variable contents.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cache
$cache_data
$config
$config_data
$container
$cookies
$request

Открытые методы

Метод Описание
__construct ( ) Initialises the factory with a set of default config and cache values.
check ( PHPUnit_Framework_Assert $test ) Check if the cache used for the generated session contains correct data.
get_cache_data ( ) : array Retrieve the entire cache data to be passed to the session.
get_config_data ( ) : array Retrieve the entire config data to be passed to the session.
get_server_data ( ) : array Retrieve all server variables to be passed to the session.
get_session ( phpbb\db\driver\driver_interface $dbal ) : phpbb_mock_session_testable Retrieve the configured session class instance
merge_cache_data ( array $cache_data ) Merge the cache contents with more data.
merge_config_data ( array $config_data ) Merge config data with the current config data to be supplied to session.
merge_server_data ( array $server_data ) Merge the current server info ($_SERVER) with more data.
merge_test_data ( $session_id, $user_id, $user_agent, $ip, integer $time ) Set cookies, merge config and server data in one step.
set_cookies ( array $cookies ) Set the cookies which should be present in the request data.

Описание методов

__construct() публичный Метод

Initialises the factory with a set of default config and cache values.
public __construct ( )

check() публичный Метод

Check if the cache used for the generated session contains correct data.
public check ( PHPUnit_Framework_Assert $test )
$test PHPUnit_Framework_Assert The test case to call assert methods on

get_cache_data() публичный Метод

Retrieve the entire cache data to be passed to the session.
public get_cache_data ( ) : array
Результат array Cache contents

get_config_data() публичный Метод

Retrieve the entire config data to be passed to the session.
public get_config_data ( ) : array
Результат array Configuration

get_server_data() публичный Метод

Retrieve all server variables to be passed to the session.
public get_server_data ( ) : array
Результат array Server variables

get_session() публичный Метод

Retrieve the configured session class instance
public get_session ( phpbb\db\driver\driver_interface $dbal ) : phpbb_mock_session_testable
$dbal phpbb\db\driver\driver_interface The database connection to use for session data
Результат phpbb_mock_session_testable A session instance

merge_cache_data() публичный Метод

New values overwrite old ones.
public merge_cache_data ( array $cache_data )
$cache_data array The additional cache data

merge_config_data() публичный Метод

New values overwrite new ones.
public merge_config_data ( array $config_data )
$config_data array The config data to merge with previous data

merge_server_data() публичный Метод

New values overwrite old ones.
public merge_server_data ( array $server_data )
$server_data array The additional server variables

merge_test_data() публичный Метод

New values overwrite old ones.
public merge_test_data ( $session_id, $user_id, $user_agent, $ip, integer $time )
$session_id
$user_id
$user_agent
$ip
$time integer

set_cookies() публичный Метод

Set the cookies which should be present in the request data.
public set_cookies ( array $cookies )
$cookies array The cookie data, structured like $_COOKIE contents.

Описание свойств

$cache защищенное свойство

protected $cache

$cache_data защищенное свойство

protected $cache_data

$config защищенное свойство

protected $config

$config_data защищенное свойство

protected $config_data

$container защищенное свойство

protected $container

$cookies защищенное свойство

protected $cookies

$request защищенное свойство

protected $request