Fixing test case

This commit is contained in:
Chris Hallgren 2016-02-15 19:34:05 -06:00
parent 0c183b9b8e
commit 849abab6a4

View file

@ -153,11 +153,11 @@ class CakeRequestTest extends CakeTestCase {
*/ */
public function testContentType() { public function testContentType() {
$_SERVER['HTTP_CONTENT_TYPE'] = 'application/json'; $_SERVER['HTTP_CONTENT_TYPE'] = 'application/json';
$request = Request::createFromGlobals(); $request = new CakeRequest('/', false);
$this->assertEquals('application/json', $request->contentType()); $this->assertEquals('application/json', $request->contentType());
$_SERVER['CONTENT_TYPE'] = 'application/xml'; $_SERVER['CONTENT_TYPE'] = 'application/xml';
$request = Request::createFromGlobals(); $request = new CakeRequest('/', false);
$this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.'); $this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.');
} }