PHP Class lithium\tests\cases\action\ControllerTest

Inheritance: extends lithium\test\Unit
Datei anzeigen Open project: unionofrad/lithium

Public Methods

Method Description
testConstructionWithCustomRequest ( ) Tests that controllers can be instantiated with custom request objects.
testDispatchingWithExplicitControllerName ( ) Tests that requests which are dispotched with the controller route parameter specified as a fully-qualified class name are able to locate their templates correctly.
testLibraryScoping ( ) Tests that the library of the controller is automatically added to the default rendering options.
testManuallySettingTemplate ( ) Tests that $_render['template'] can be manually set in a controller action and will not be overwritten.
testMethodInvocation ( ) Tests the use of Controller::__invoke() for dispatching requests to action methods. Also tests that using PHP's callable syntax yields the same result as calling __invoke() explicitly.
testNonExistentFunction ( )
testProtectedMethodAccessAttempt ( ) Verifies that protected methods (i.e. prefixed with '_'), and methods declared in the Controller base class cannot be accessed.
testRedirectResponse ( ) Tests that calls to Controller::redirect() correctly write redirect headers to the response object.
testRenderPropertyInheritance ( )
testRenderWithAlternateTemplate ( ) Tests calling Controller::render() with parameters to render an alternate template from the default.
testRenderWithDataArray ( ) Verifies that data array is passed on to controller's response.
testRenderWithDataSingleIndexedArray ( ) Verifies that the Controller does not modify data when passed an array (or RecordSet) with a single element.
testRenderWithNamespacedController ( ) Tests that requests where the controller class is specified manually continue to route to the correct template path.
testResponseStatus ( )
testResponseTypeBasedOnRequestHeaderType ( )
testResponseTypeBasedOnRequestParamsType ( )
testResponseTypeBasedOnRequestType ( )
testSetData ( )

Method Details

testConstructionWithCustomRequest() public method

Tests that controllers can be instantiated with custom request objects.

testDispatchingWithExplicitControllerName() public method

Tests that requests which are dispotched with the controller route parameter specified as a fully-qualified class name are able to locate their templates correctly.

testLibraryScoping() public method

Tests that the library of the controller is automatically added to the default rendering options.
public testLibraryScoping ( )

testManuallySettingTemplate() public method

Tests that $_render['template'] can be manually set in a controller action and will not be overwritten.

testMethodInvocation() public method

Tests the use of Controller::__invoke() for dispatching requests to action methods. Also tests that using PHP's callable syntax yields the same result as calling __invoke() explicitly.

testNonExistentFunction() public method

testProtectedMethodAccessAttempt() public method

Verifies that protected methods (i.e. prefixed with '_'), and methods declared in the Controller base class cannot be accessed.

testRedirectResponse() public method

Tests that calls to Controller::redirect() correctly write redirect headers to the response object.

testRenderPropertyInheritance() public method

testRenderWithAlternateTemplate() public method

Tests calling Controller::render() with parameters to render an alternate template from the default.

testRenderWithDataArray() public method

Verifies that data array is passed on to controller's response.

testRenderWithDataSingleIndexedArray() public method

Verifies that the Controller does not modify data when passed an array (or RecordSet) with a single element.

testRenderWithNamespacedController() public method

Tests that requests where the controller class is specified manually continue to route to the correct template path.

testResponseStatus() public method

public testResponseStatus ( )

testResponseTypeBasedOnRequestHeaderType() public method

testResponseTypeBasedOnRequestParamsType() public method

testResponseTypeBasedOnRequestType() public method

testSetData() public method

public testSetData ( )