Skip to content

Commit

Permalink
Fixed and better type hinting for the Travis CI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
iliepandia committed Apr 22, 2018
1 parent a0eb569 commit 4a19d6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/TestSuite/IntegrationTestCase.php
Expand Up @@ -484,12 +484,13 @@ protected function _sendRequest($url, $method, $data = [])
{
$dispatcher = $this->_makeDispatcher();
try {
$psrRequest = null;
$request = $this->_buildRequest($url, $method, $data);
$psrRequest = $this->_createRequest($request);
if ($dispatcher instanceof LegacyRequestDispatcher) {
//The legacy dispatcher expects an array...
$response = $dispatcher->execute($request);
} elseif ($dispatcher instanceof MiddlewareDispatcher) {
$psrRequest = $this->_createRequest($request);
} else {
$response = $dispatcher->execute($psrRequest);
}
$this->_requestSession = $request['session'];
Expand Down Expand Up @@ -587,7 +588,7 @@ public function controllerSpy($event, $controller = null)
* If that class does not exist, the built-in renderer will be used.
*
* @param \Exception $exception Exception to handle.
* @param \Psr\Http\Message\ServerRequestInterface $request The request.
* @param \Psr\Http\Message\RequestInterface $request The request.
* @return void
* @throws \Exception
*/
Expand Down
2 changes: 1 addition & 1 deletion src/TestSuite/MiddlewareDispatcher.php
Expand Up @@ -68,7 +68,7 @@ public function __construct($test, $class = null, $constructorArgs = null)
/**
* Run a request and get the response.
*
* @param \Cake\Http\ServerRequest $request The request to execute.
* @param \Psr\Http\Message\RequestInterface $request The request to execute.
* @return \Psr\Http\Message\ResponseInterface The generated response.
*/
public function execute($request)
Expand Down

0 comments on commit 4a19d6f

Please sign in to comment.