Slide 23
Slide 23 text
Testing backend APIs
public function testBasicExample()
{
$response = $this->withHeaders([
'X-Header' => 'Value',
])->json('POST', '/user', ['name' => 'Sally']);
$response
->assertStatus(201)
->assertJson([
'created' => true,
]);
}
https://laravel.com/docs/7.x/http-tests