Throws

Options:

data Will be used as the request data. If the method is GET,
data will be used a GET params. If the method is POST, it will be used
as POST data. By setting $options['data'] to a string, you can simulate XML or JSON
payloads to your controllers allowing you to test REST webservices.

method POST or GET. Defaults to POST.

return Specify the return type you want. Choose from:

vars Get the set view variables.

view Get the rendered view, without a layout.

contents Get the rendered view including the layout.

result Get the return value of the controller action. Useful
for testing requestAction methods.

Parameters

Returns

Generates a mocked controller and mocks any classes passed to $mocks. By
default, _stop() is stubbed as is sending the response headers, so to not
interfere with testing.

Mocks:

methods Methods to mock on the controller. _stop() is mocked by default

models Models to mock. Models are added to the ClassRegistry so any
time they are instantiated the mock will be created. Pass as key value pairs
with the value being specific methods on the model to mock. If true or
no value is passed, the entire model will be mocked.

components Components to mock. Components are only mocked on this controller
and not within each other (i.e., components on components)