Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
lumen 5.5.2中的phpunit测试无法使用请求类获取json数据_Php_Laravel_Phpunit_Lumen - Fatal编程技术网

lumen 5.5.2中的phpunit测试无法使用请求类获取json数据

lumen 5.5.2中的phpunit测试无法使用请求类获取json数据,php,laravel,phpunit,lumen,Php,Laravel,Phpunit,Lumen,我使用lumen 5.5.2,我想为此创建http测试。所以我使用了以下代码: class ExampleTest extends \TestCase { public function testExample() { $header = [ 'access-token' => '$2y$10$Z6PvDMkTVVaSQJD10YGEsOz6E2KdQ2Q9RKo7roanZIAwRz0thUoAS', 'refresh

我使用
lumen 5.5.2
,我想为此创建http测试。所以我使用了以下代码:

class ExampleTest extends \TestCase
{
    public function testExample()
    {
        $header = [
         'access-token'  => '$2y$10$Z6PvDMkTVVaSQJD10YGEsOz6E2KdQ2Q9RKo7roanZIAwRz0thUoAS',
         'refresh-token' => '$2y$10$WA12Phc979GKN9xht89Fv.RSeaS/R4MErWTjLYY1mNC8vS03E84XC',
         'app-name'      => 'test',
         'app-secret'    => 'test',
         'Content-Type'  => 'application/json'
        ];

        $json=[
         "gdata"=>[
          "title"=>"testTitle",
          "slug"=>"testSlug",
          "tag"=>"testTag",
          "scope"=>1
         ]
        ];
        $this->json('POST', '/settings/gdata/create', $json, $header)->seeJson([ 'status' => true ]);
    }
}
但是我无法使用lumen
请求获取
$json
数据,当我获取该数据时,它是空的