Skip to content
Permalink
Browse files

Add session support for PSR7 requests.

  • Loading branch information...
markstory committed Jun 18, 2016
1 parent da39cd3 commit 61ef064686e6eac5599ef566e1796b291d521225
Showing with 16 additions and 0 deletions.
  1. +1 −0 src/TestSuite/MiddlewareDispatcher.php
  2. +15 −0 tests/TestCase/TestSuite/IntegrationTestCaseTest.php
@@ -76,6 +76,7 @@ public function execute($request)
$request['post'],
$request['cookies']
);
$psrRequest = $psrRequest->withAttribute('session', $request['session']);
$response = $server->run($psrRequest);
return ResponseTransformer::toCake($response);
}
@@ -243,6 +243,21 @@ public function testPostDataHttpServer()
$this->assertHeader('X-Middleware', 'true');
}
/**
* Test that the PSR7 requests get cookies
*
* @return void
*/
public function testSessionHttpServer()
{
$this->useHttpServer(true);
$this->session(['foo' => 'session data']);
$this->get('/request_action/session_test');
$this->assertResponseOk();
$this->assertResponseContains('session data');
$this->assertHeader('X-Middleware', 'true');
}
/**
* Test sending requests stores references to controller/view/layout.

0 comments on commit 61ef064

Please sign in to comment.
You can’t perform that action at this time.