Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/dashboard');
php artisan test
public function test_the_application_returns_a_successful_response()
{
$response = $this->get('/');
$response->assertStatus(200);
}
$this->assertDatabaseHas('users', [
'email' => 'sally@example.com'
]);
$response->assertJson(['created' => true]);
$response->assertRedirect('/home');