From 0bef3d8944870208380ae091561be1aa23752e6c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 16 Dec 2016 14:44:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/requestTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/thinkphp/library/think/requestTest.php b/tests/thinkphp/library/think/requestTest.php index ef5f8e98..7d89fa36 100644 --- a/tests/thinkphp/library/think/requestTest.php +++ b/tests/thinkphp/library/think/requestTest.php @@ -90,12 +90,14 @@ class requestTest extends \PHPUnit_Framework_TestCase public function testType() { - $request = Request::instance(); - $_SERVER['HTTP_ACCEPT'] = 'application/json'; + $request = Request::instance(); + $request->server(['HTTP_ACCEPT' => 'application/json']); + $this->assertEquals('json', $request->type()); $request->mimeType('test', 'application/test'); $request->mimeType(['test' => 'application/test']); - $_SERVER['HTTP_ACCEPT'] = 'application/test'; + $request->server(['HTTP_ACCEPT' => 'application/test']); + $this->assertEquals('test', $request->type()); }