Skip to content

Commit

Permalink
Add a few more integration tests for the PSR7 http stack.
Browse files Browse the repository at this point in the history
I think this covers all the cases I can think of right now.
  • Loading branch information
markstory committed Jun 23, 2016
1 parent 38c903b commit 985d50c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/TestCase/TestSuite/IntegrationTestCaseTest.php
Expand Up @@ -469,6 +469,20 @@ public function testWithExpectedException()
$this->assertResponseCode(500);
}

/**
* Test that exceptions being thrown are handled correctly by the psr7 stack.
*
* @return void
*/
public function testWithExpectedExceptionHttpServer()
{
DispatcherFactory::clear();
$this->useHttpServer(true);

$this->get('/tests_apps/throw_exception');
$this->assertResponseCode(500);
}

/**
* Test that exceptions being thrown are handled correctly.
*
Expand All @@ -493,6 +507,21 @@ public function testRedirect()
$this->assertResponseCode(302);
}

/**
* Test redirecting and psr7 stack
*
* @return void
*/
public function testRedirectHttpServer()
{
DispatcherFactory::clear();
$this->useHttpServer(true);

$this->post('/tests_apps/redirect_to');
$this->assertResponseCode(302);
$this->assertHeader('X-Middleware', 'true');
}

/**
* Test redirecting and integration tests.
*
Expand Down

0 comments on commit 985d50c

Please sign in to comment.