Class MiddlewareDispatcher
Dispatches a request capturing the response for integration testing purposes into the Cake\Http stack.
        
    Namespace: Cake\TestSuite
    
    
    
      
  
      Property Summary
- 
        $app protectedCake\Core\HttpApplicationInterfaceThe application that is being dispatched. 
Method Summary
- 
          __construct() publicConstructor 
- 
          _createRequest() protectedCreate a PSR7 request from the request spec. 
- 
          execute() publicRun a request and get the response. 
- 
          resolveRoute() protectedConvert a URL array into a string URL via routing. 
- 
          resolveUrl() publicResolve the provided URL into a string. 
Method Detail
__construct() ¶ public
__construct(Cake\Core\HttpApplicationInterface $app)Constructor
Parameters
- 
                Cake\Core\HttpApplicationInterface$app
- The test case to run. 
_createRequest() ¶ protected
_createRequest(array<string, mixed> $spec): Cake\Http\ServerRequestCreate a PSR7 request from the request spec.
Parameters
- 
                array<string, mixed>$spec
- The request spec. 
Returns
Cake\Http\ServerRequestexecute() ¶ public
execute(array<string, mixed> $requestSpec): Psr\Http\Message\ResponseInterfaceRun a request and get the response.
Parameters
- 
                array<string, mixed>$requestSpec
- The request spec to execute. 
Returns
Psr\Http\Message\ResponseInterfaceThe generated response.
Throws
LogicExceptionresolveRoute() ¶ protected
resolveRoute(array $url): stringConvert a URL array into a string URL via routing.
Parameters
- 
                array$url
- The url to resolve 
Returns
stringresolveUrl() ¶ public
resolveUrl(array|string $url): stringResolve the provided URL into a string.
Parameters
- 
                array|string$url
- The URL array/string to resolve. 
Returns
string