Dispatches a request capturing the response for integration testing purposes into the Cake\Http stack.
string
The application class name
array
Constructor arguments for your application class.
\Cake\TestSuite\TestCase
The test case being run.
\Cake\Core\HttpApplicationInterface
The application that is being dispatched.
__construct(\Cake\TestSuite\TestCase $test, ?string $class, ?array $constructorArgs)
Constructor
\Cake\TestSuite\TestCase
$test The test case to run.
string|null
$class optional The application class name. Defaults to App\Application.
array|null
$constructorArgs optional The constructor arguments for your application class. Defaults to ['./config']
LogicException
_createRequest(array $spec)
Create a PSR7 request from the request spec.
array
$spec The request spec.
\Cake\Http\ServerRequest
execute(array $requestSpec)
Run a request and get the response.
array
$requestSpec The request spec to execute.
\Psr\Http\Message\ResponseInterface
The generated response.
LogicException
resolveRoute(array $url)
Convert a URL array into a string URL via routing.
array
$url The url to resolve
string
resolveUrl(mixed $url)
Resolve the provided URL into a string.
array|string
$url The URL array/string to resolve.
string
The application class name
string
Constructor arguments for your application class.
array
The test case being run.
\Cake\TestSuite\TestCase
The application that is being dispatched.
\Cake\Core\HttpApplicationInterface
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.TestSuite.MiddlewareDispatcher.html