Browse Source

Merge pull request #4610 from rapsspider/patch-1

Update IntegrationTestCase::_buildRequest
José Lorenzo Rodríguez 11 years ago
parent
commit
4255491bf6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/TestSuite/IntegrationTestCase.php

+ 3 - 2
src/TestSuite/IntegrationTestCase.php

@@ -320,14 +320,15 @@ class IntegrationTestCase extends TestCase {
 			'cookies' => $this->_cookie,
 			'session' => $session,
 		];
+		$env = [];
 		if (isset($this->_request['headers'])) {
-			$env = [];
 			foreach ($this->_request['headers'] as $k => $v) {
 				$env['HTTP_' . str_replace('-', '_', strtoupper($k))] = $v;
 			}
-			$props['environment'] = $env;
 			unset($this->_request['headers']);
 		}
+		$env['REQUEST_METHOD'] = $method;
+		$props['environment'] = $env;
 		$props += $this->_request;
 		return new Request($props);
 	}