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:
Sam Minnee 2008-08-11 05:55:31 +00:00
parent 34479223fa
commit 69100325ca

View File

@ -162,15 +162,15 @@ class Director {
$existingSessionVars = $_SESSION;
// Replace the superglobals with appropriate test values
$_REQUEST = array_merge((array)$getVars, (array)$post);
$_REQUEST = array_merge((array)$getVars, (array)$postVars);
$_GET = (array)$getVars;
$_POST = (array)$post;
$_POST = (array)$postVars;
$_SESSION = $session ? $session->inst_getAll() : array();
$req = new HTTPRequest($httpMethod, $url, $getVars, $postVars, $body);
if($headers) foreach($headers as $k => $v) $req->addHeader($k, $v);
$result = Director::handleRequest($req, $session);
// Restore the superglobals
$_REQUEST = $existingRequestVars;
$_GET = $existingGetVars;