PHP Class CIPHPUnitTestRequest, ci-phpunit-test

Afficher le fichier Open project: kenjis/ci-phpunit-test Class Usage Examples

Protected Properties

Свойство Type Description
$callablePreConstructors callable called pre controller constructor
$callables callable called post controller constructor
$enableHooks
$hooks CI_Hooks
$router CIPHPUnitTestRouter
$superGlobal CIPHPUnitTestSuperGlobal
$testCase

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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 )

Method Details

__construct() public méthode

public __construct ( PHPUnit_Framework_TestCase $testCase )
$testCase PHPUnit_Framework_TestCase

addCallable() public méthode

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

addCallablePreConstructor() public méthode

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

callControllerMethod() protected méthode

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 méthode

protected callHook ( $hook )

createAndCallController() protected méthode

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

enableHooks() public méthode

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

getStatus() public méthode

Get HTTP Status Code Info
public getStatus ( ) : array
Résultat array ['code' => code, 'text' => text]

processError() protected méthode

protected processError ( Exception $e )
$e Exception

request() public méthode

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() protected méthode

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() public méthode

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

setCallablePreConstructor() public méthode

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

setHeader() public méthode

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

setRawInputStream() protected méthode

protected setRawInputStream ( $string )

Property Details

$callablePreConstructors protected_oe property

callable called pre controller constructor
protected $callablePreConstructors

$callables protected_oe property

callable called post controller constructor
protected $callables

$enableHooks protected_oe property

protected $enableHooks

$hooks protected_oe property

protected CI_Hooks $hooks
Résultat CI_Hooks

$router protected_oe property

protected CIPHPUnitTestRouter $router
Résultat CIPHPUnitTestRouter

$superGlobal protected_oe property

protected CIPHPUnitTestSuperGlobal $superGlobal
Résultat CIPHPUnitTestSuperGlobal

$testCase protected_oe property

protected $testCase