测试里的 header 怎么清除不了?
$token = $this->post('/api/login',['username'=>$username,'password'=>$pwd])
->assertJsonStructure(['success','token'])->json('token');
$this->withHeader('Authorization','Bearer '.$token);
$this->get('/api/brands')->assertStatus(200);
$this->flushHeaders();
$this->get('/api/brands')->assertStatus(401);
然后运行报错了,清除了headers之后还是200
推荐文章: