PHP Класс CIPHPUnitTestRequest, ci-phpunit-test

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$callablePreConstructors callable called pre controller constructor
$callables callable called post controller constructor
$enableHooks
$hooks CI_Hooks
$router CIPHPUnitTestRouter
$superGlobal CIPHPUnitTestSuperGlobal
$testCase

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

Метод Описание
__construct ( PHPUnit_Framework_TestCase $testCase )
addCallable ( callable $callable ) Add callable
addCallablePreConstructor ( callable $callable ) Add callable pre constructor
enableHooks ( ) Enable Hooks for Controllres This enables only pre_controller, post_controller_constructor, post_controller
getStatus ( ) : array Get HTTP Status Code Info
request ( string $http_method, array | string $argv, array | string $params = [] ) Request to Controller
setCallable ( callable $callable ) Set (and Reset) callable
setCallablePreConstructor ( callable $callable ) Set (and Reset) callable pre constructor
setHeader ( string $name, string $value ) Set HTTP request header

Защищенные методы

Метод Описание
callControllerMethod ( string $http_method, array $argv, array | string $request_params ) Call Controller Method
callHook ( $hook )
createAndCallController ( $class, $method, $params, $call_display = true )
processError ( Exception $e )
requestUri ( string $http_method, string $uri, array | string $request_params ) Request to URI
setRawInputStream ( $string )

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

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

public __construct ( PHPUnit_Framework_TestCase $testCase )
$testCase PHPUnit_Framework_TestCase

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

Add callable
public addCallable ( callable $callable )
$callable callable function to run after controller instantiation

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

Add callable pre constructor
public addCallablePreConstructor ( callable $callable )
$callable callable function to run before controller instantiation

callControllerMethod() защищенный Метод

Call Controller Method
protected callControllerMethod ( string $http_method, array $argv, array | string $request_params )
$http_method string HTTP method
$argv array controller, method [, arg1, ...]
$request_params array | string POST params/GET params|raw_input_stream

callHook() защищенный Метод

protected callHook ( $hook )

createAndCallController() защищенный Метод

protected createAndCallController ( $class, $method, $params, $call_display = true )

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

Enable Hooks for Controllres This enables only pre_controller, post_controller_constructor, post_controller
public enableHooks ( )

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

Get HTTP Status Code Info
public getStatus ( ) : array
Результат array ['code' => code, 'text' => text]

processError() защищенный Метод

protected processError ( Exception $e )
$e Exception

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

Request to Controller
public request ( string $http_method, array | string $argv, array | string $params = [] )
$http_method string HTTP method
$argv array | string array of controller,method,arg|uri
$params array | string POST params/GET params|raw_input_stream

requestUri() защищенный Метод

Request to URI
protected requestUri ( string $http_method, string $uri, array | string $request_params )
$http_method string HTTP method
$uri string URI string
$request_params array | string POST params/GET params|raw_input_stream

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

Set (and Reset) callable
public setCallable ( callable $callable )
$callable callable function to run after controller instantiation

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

Set (and Reset) callable pre constructor
public setCallablePreConstructor ( callable $callable )
$callable callable function to run before controller instantiation

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

Set HTTP request header
public setHeader ( string $name, string $value )
$name string header name
$value string value

setRawInputStream() защищенный Метод

protected setRawInputStream ( $string )

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

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

callable called pre controller constructor
protected $callablePreConstructors

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

callable called post controller constructor
protected $callables

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

protected $enableHooks

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

protected CI_Hooks $hooks
Результат CI_Hooks

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

protected CIPHPUnitTestRouter $router
Результат CIPHPUnitTestRouter

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

protected CIPHPUnitTestSuperGlobal $superGlobal
Результат CIPHPUnitTestSuperGlobal

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

protected $testCase