mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Further fixes to Director::test()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60404 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
34479223fa
commit
69100325ca
@ -162,15 +162,15 @@ class Director {
|
|||||||
$existingSessionVars = $_SESSION;
|
$existingSessionVars = $_SESSION;
|
||||||
|
|
||||||
// Replace the superglobals with appropriate test values
|
// Replace the superglobals with appropriate test values
|
||||||
$_REQUEST = array_merge((array)$getVars, (array)$post);
|
$_REQUEST = array_merge((array)$getVars, (array)$postVars);
|
||||||
$_GET = (array)$getVars;
|
$_GET = (array)$getVars;
|
||||||
$_POST = (array)$post;
|
$_POST = (array)$postVars;
|
||||||
$_SESSION = $session ? $session->inst_getAll() : array();
|
$_SESSION = $session ? $session->inst_getAll() : array();
|
||||||
|
|
||||||
$req = new HTTPRequest($httpMethod, $url, $getVars, $postVars, $body);
|
$req = new HTTPRequest($httpMethod, $url, $getVars, $postVars, $body);
|
||||||
if($headers) foreach($headers as $k => $v) $req->addHeader($k, $v);
|
if($headers) foreach($headers as $k => $v) $req->addHeader($k, $v);
|
||||||
$result = Director::handleRequest($req, $session);
|
$result = Director::handleRequest($req, $session);
|
||||||
|
|
||||||
// Restore the superglobals
|
// Restore the superglobals
|
||||||
$_REQUEST = $existingRequestVars;
|
$_REQUEST = $existingRequestVars;
|
||||||
$_GET = $existingGetVars;
|
$_GET = $existingGetVars;
|
||||||
|
Loading…
Reference in New Issue
Block a user