我使用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 ]);
}
}
但我无法通过流明$json
获取Request
数据,当我得到它时,它是空的。