Skip to content
Permalink
Browse files

Set PHP_SELF in the integration test case.

This removes the need for users to set `$_SERVER['PHP_SELF']` in their
tests/bootstrap.php. While this is something included in the app
template existing apps don't have it and it leads to hard to debug
failures.

Refs #12075
  • Loading branch information...
markstory committed May 12, 2018
1 parent 2272d26 commit 2f0ce8d384010d42916f25021c94b0a5896e3455
Showing with 5 additions and 4 deletions.
  1. +5 −1 src/TestSuite/MiddlewareDispatcher.php
  2. +0 −3 tests/bootstrap.php
@@ -108,8 +108,12 @@ protected function _createRequest($spec)
if (isset($spec['input'])) {
$spec['post'] = [];
}
$environment = array_merge(
array_merge($_SERVER, ['REQUEST_URI' => $spec['url'], 'PHP_SELF' => '/']),
$spec['environment']
);
$request = ServerRequestFactory::fromGlobals(
array_merge($_SERVER, $spec['environment'], ['REQUEST_URI' => $spec['url']]),
$environment,
$spec['query'],
$spec['post'],
$spec['cookies']
@@ -139,6 +139,3 @@
// does not allow the sessionid to be set after stdout
// has been written to.
session_id('cli');
// Fix multiple http/server requests in a single test method.
$_SERVER['PHP_SELF'] = '/';

0 comments on commit 2f0ce8d

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