From e78e6c7c6a1241a2a7728ebb024b706d6d5b86d0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 17 Nov 2021 11:44:55 +0900 Subject: [PATCH 1/3] docs: fix execute() explanation --- user_guide_src/source/testing/controllers.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/testing/controllers.rst b/user_guide_src/source/testing/controllers.rst index e99a24d935f9..94ef7dad1135 100644 --- a/user_guide_src/source/testing/controllers.rst +++ b/user_guide_src/source/testing/controllers.rst @@ -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. From 58644197b6cc4cbcbf94c12f11ead23ddd655042 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 17 Nov 2021 11:45:31 +0900 Subject: [PATCH 2/3] docs: fix withURI() signature --- user_guide_src/source/testing/controllers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/testing/controllers.rst b/user_guide_src/source/testing/controllers.rst index 94ef7dad1135..1f16cd615fc2 100644 --- a/user_guide_src/source/testing/controllers.rst +++ b/user_guide_src/source/testing/controllers.rst @@ -135,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 From 2d867408f32f0e033c09904f1adbb232ffe41234 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 17 Nov 2021 11:45:53 +0900 Subject: [PATCH 3/3] docs: elaborate on isOK() --- user_guide_src/source/testing/response.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/testing/response.rst b/user_guide_src/source/testing/response.rst index e5e0f34852ff..c5f7d9c34fbe 100644 --- a/user_guide_src/source/testing/response.rst +++ b/user_guide_src/source/testing/response.rst @@ -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()) {