ControllerTestCase Class Reference

Detailed Description

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

ingo herwig

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()

runRequest (   $action,
  $addActionKey = true 

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.

$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)
Response instance

Definition at line 35 of file ControllerTestCase.php.

◆ runRequestFromThis()

runRequestFromThis (   $action,
  $addActionKey = true 

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

See also

Definition at line 43 of file ControllerTestCase.php.

◆ getControllerName()

getControllerName ( )

Get the fully qualified name of the controller to test.

The name of the controller