mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正单元测试
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
namespace tests\thinkphp\library\think;
|
namespace tests\thinkphp\library\think;
|
||||||
|
|
||||||
use think\Config;
|
use think\Config;
|
||||||
|
use think\Request;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
class responseTest extends \PHPUnit_Framework_TestCase
|
class responseTest extends \PHPUnit_Framework_TestCase
|
||||||
@@ -84,9 +85,10 @@ class responseTest extends \PHPUnit_Framework_TestCase
|
|||||||
$response = Response::create($dataArr, 'json');
|
$response = Response::create($dataArr, 'json');
|
||||||
$result = $response->getContent();
|
$result = $response->getContent();
|
||||||
$this->assertEquals('{"key":"value"}', $result);
|
$this->assertEquals('{"key":"value"}', $result);
|
||||||
$_GET['callback'] = 'callback';
|
$request = Request::instance();
|
||||||
$response = Response::create($dataArr, 'jsonp');
|
$request->get(['callback' => 'callback']);
|
||||||
$result = $response->options(['var_jsonp_handler' => 'callback'])->getContent();
|
$response = Response::create($dataArr, 'jsonp');
|
||||||
|
$result = $response->getContent();
|
||||||
$this->assertEquals('callback({"key":"value"});', $result);
|
$this->assertEquals('callback({"key":"value"});', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user