From bd8b22414e82fd0a0efa4b00fc493815b9e75758 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 5 Sep 2016 16:33:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/responseTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/thinkphp/library/think/responseTest.php b/tests/thinkphp/library/think/responseTest.php index ea2ccd56..aa21a4b6 100644 --- a/tests/thinkphp/library/think/responseTest.php +++ b/tests/thinkphp/library/think/responseTest.php @@ -17,6 +17,7 @@ namespace tests\thinkphp\library\think; use think\Config; +use think\Request; use think\Response; class responseTest extends \PHPUnit_Framework_TestCase @@ -84,9 +85,10 @@ class responseTest extends \PHPUnit_Framework_TestCase $response = Response::create($dataArr, 'json'); $result = $response->getContent(); $this->assertEquals('{"key":"value"}', $result); - $_GET['callback'] = 'callback'; - $response = Response::create($dataArr, 'jsonp'); - $result = $response->options(['var_jsonp_handler' => 'callback'])->getContent(); + $request = Request::instance(); + $request->get(['callback' => 'callback']); + $response = Response::create($dataArr, 'jsonp'); + $result = $response->getContent(); $this->assertEquals('callback({"key":"value"});', $result); }