ControllerTestCase Class Reference

Detailed Description

ControllerTestCase is the base class for test cases used for Controllers.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 22 of file ControllerTestCase.php.

+ Inheritance diagram for ControllerTestCase:

Protected Member Functions

 runRequest ($action, $data, $addActionKey=true)
 
 runRequestFromThis ($action, $data, $addActionKey=true)
 
 getControllerName ()
 
- Protected Member Functions inherited from DatabaseTestCase
 setUp ()
 
 tearDown ()
 
 executeSql ($type, $sql, $parameters=[])
 

Additional Inherited Members

- Public Member Functions inherited from DatabaseTestCase
 getConnection ()
 
 run (\PHPUnit_Framework_TestResult $result=null)
 

Member Function Documentation

runRequest (   $action,
  $data,
  $addActionKey = true 
)
protected

Make a request to the controller.

This method makes sure that the requested action is routed to the controller to be tested. The calling method has to make sure that a session is started, if necessary (e.g. by calling TestUtil::startSession()). The transaction will be rolled back before the request is run in order to avoid side effects.

Parameters
$actionThe action
$dataAn associative array with additional key/value pairs for the Request instance $addActionKey Boolean, whether to add an action key for the given action to the configuration or not (optional, default: true)
Returns
Response instance

Definition at line 35 of file ControllerTestCase.php.

runRequestFromThis (   $action,
  $data,
  $addActionKey = true 
)
protected

Make a request to the controller with the controller set as sender.

See also
ControllerTestCase::runRequest()

Definition at line 43 of file ControllerTestCase.php.

getControllerName ( )
abstractprotected

Get the fully qualified name of the controller to test.

Returns
The name of the controller