Skip to content

CIPHPUnitTestRequest

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CIPHPUnitTestRequest

Part of CI PHPUnit Test

  • Class name: CIPHPUnitTestRequest
  • Namespace:

Properties

$callable

protected callable $callable
  • Visibility: protected

$callablePreConstructor

protected callable $callablePreConstructor
  • Visibility: protected

$enableHooks

protected mixed $enableHooks = false
  • Visibility: protected

$CI

protected mixed $CI
  • Visibility: protected

$bc_mode_throw_PHPUnit_Framework_Exception

protected boolean $bc_mode_throw_PHPUnit_Framework_Exception = false
  • Visibility: protected

Methods

setCallable

mixed CIPHPUnitTestRequest::setCallable(callable $callable)

Set callable

  • Visibility: public

Arguments

  • $callable callable - <p>function to run after controller instantiation</p>

setCallablePreConstructor

mixed CIPHPUnitTestRequest::setCallablePreConstructor(callable $callable)

Set callable pre constructor

  • Visibility: public

Arguments

  • $callable callable - <p>function to run before controller instantiation</p>

enableHooks

mixed CIPHPUnitTestRequest::enableHooks()

Enable Hooks for Controllres This enables only pre_controller, post_controller_constructor, post_controller

  • Visibility: public

request

mixed CIPHPUnitTestRequest::request(string $http_method, array|string $argv, array $params, callable $callable)

Request to Controller

  • Visibility: public

Arguments

  • $http_method string - <p>HTTP method</p>
  • $argv array|string - <p>array of controller,method,arg|uri</p>
  • $params array - <p>POST parameters/Query string</p>
  • $callable callable - <p>[deprecated] function to run after controller instantiation. Use setCallable() method instead</p>

callControllerMethod

mixed CIPHPUnitTestRequest::callControllerMethod(string $http_method, array $argv, array $request_params, callable $callable)

Call Controller Method

  • Visibility: protected

Arguments

  • $http_method string - <p>HTTP method</p>
  • $argv array - <p>controller, method [, arg1, ...]</p>
  • $request_params array - <p>POST parameters/Query string</p>
  • $callable callable - <p>[deprecated] function to run after controller instantiation. Use setCallable() method instead</p>

requestUri

mixed CIPHPUnitTestRequest::requestUri(string $http_method, string $uri, array $request_params, callable $callable)

Request to URI

  • Visibility: protected

Arguments

  • $http_method string - <p>HTTP method</p>
  • $uri string - <p>URI string</p>
  • $request_params array - <p>POST parameters/Query string</p>
  • $callable callable - <p>[deprecated] function to run after controller instantiation. Use setCallable() method instead</p>

createAndCallController

mixed CIPHPUnitTestRequest::createAndCallController($class, $method, $params)
  • Visibility: protected

Arguments

  • $class mixed
  • $method mixed
  • $params mixed

getRoute

array CIPHPUnitTestRequest::getRoute(\CI_Route $RTR, \CI_URI $URI)

Get Route including 404 check

  • Visibility: protected

Arguments

  • $RTR CI_Route - <p>Router object</p>
  • $URI CI_URI - <p>URI object</p>

getStatus

array CIPHPUnitTestRequest::getStatus()

Get HTTP Status Code Info

  • Visibility: public
Clone this wiki locally