Level 73
This row
$response->assertRedirect($project->path);
is the problem
It should probably have () on the end.
$response->assertRedirect($project->path());
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm at this lesson https://laracasts.com/series/build-a-laravel-app-with-tdd/episodes/14 minute 18:16
when i launch this test i get a different error than the course one
public function test_a_user_can_create_a_project()
{
$this->withoutExceptionHandling();
$this->singIn();
$this->get('/projects/create')->assertStatus(200);
$attributes = [
'title' => $this->faker->sentence,
'description' => $this->faker->paragraph,
];
$response = $this->post('/projects', $attributes);
$project = Project::where($attributes)->first();
$response->assertRedirect($project->path);
$this->assertDatabaseHas('projects',$attributes);
$this->get('/projects')->assertSee($attributes['title']);
}
gives me following errors:
This row
$response->assertRedirect($project->path);
is the problem
It should probably have () on the end.
$response->assertRedirect($project->path());
Please or to participate in this conversation.