PHP Class CIPHPUnitTestRequest, ci-phpunit-test

ファイルを表示 Open project: kenjis/ci-phpunit-test Class Usage Examples

Protected Properties

Property Type Description
$callablePreConstructors callable called pre controller constructor
$callables callable called post controller constructor
$enableHooks
$hooks CI_Hooks
$router CIPHPUnitTestRouter
$superGlobal CIPHPUnitTestSuperGlobal
$testCase

Public Methods

Method 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

Protected Methods

Method 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 method

public __construct ( PHPUnit_Framework_TestCase $testCase )
$testCase PHPUnit_Framework_TestCase

addCallable() public method

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

addCallablePreConstructor() public method

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

callControllerMethod() protected method

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 method

protected callHook ( $hook )

createAndCallController() protected method

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

enableHooks() public method

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

getStatus() public method

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

processError() protected method

protected processError ( Exception $e )
$e Exception

request() public method

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 method

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 method

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

setCallablePreConstructor() public method

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

setHeader() public method

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

setRawInputStream() protected method

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
return CI_Hooks

$router protected_oe property

protected CIPHPUnitTestRouter $router
return CIPHPUnitTestRouter

$superGlobal protected_oe property

protected CIPHPUnitTestSuperGlobal $superGlobal
return CIPHPUnitTestSuperGlobal

$testCase protected_oe property

protected $testCase