Answer the question
In order to leave comments, you need to log in
Why does the test fail with Failed asserting that an array has the key 'id'?
Tell me why the error when testing Failed asserting that an array has the key 'id' ?
public function test_qr_code_customer()
{
$token = 'v4jdlUW5W370VchqlSIDzL5LHjqxXv4jgo37dTP2';
$response = $this->withHeaders([
'Authorization' => 'Bearer ' . $token,
])->get('/api/qr-code/customer');
$response
->assertOk()
->assertJsonStructure([
'ok',
'data' => [
'user' => [
'id',
'code'
]
]
])
;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question