Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions user_guide_src/source/testing/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ Specifies the class name of the controller to test. The first parameter must be

$this->controller(\App\Controllers\ForumController::class);

**execute($method)**
**execute(string $method, ...$params)**

Executes the specified method within the controller. The only parameter is the name of the method to run::
Executes the specified method within the controller. The first parameter is the name of the method to run::

$results = $this->controller(\App\Controllers\ForumController::class)
->execute('showCategories');

By specifying the second and subsequent parameters, you can pass them to the controller method.

This returns a new helper class that provides a number of routines for checking the response itself. See below
for details.

Expand Down Expand Up @@ -133,7 +135,7 @@ Allows you to provide a **Logger** instance::
If you do not provide one, a new Logger instance with the default configuration values will be passed
into your controller.

**withURI($uri)**
**withURI(string $uri)**

Allows you to provide a new URI that simulates the URL the client was visiting when this controller was run.
This is helpful if you need to check URI segments within your controller. The only parameter is a string
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/testing/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Checking Response Status
**isOK()**

Returns a boolean true/false based on whether the response is perceived to be "ok". This is primarily determined by
a response status code in the 200 or 300's.
a response status code in the 200 or 300's. An empty body is not considered valid, unless in redirects.
::

if ($result->isOK()) {
Expand Down