create(['name' => 'Test Project']); $this->assertStringEndsWith( '/storage/test_project/attachments', $project->attachment_path ); } /** @test */ public function it_can_add_a_mailing_and_attachment() { $project = Project::factory()->create(); $project->mailings()->create([ 'subject' => 'Test Subject', 'message' => 'Test Message', ]); $fileFake = \Illuminate\Http\UploadedFile::fake()->create('test.pdf'); $project->mailings()->first()->addAttachment('test.pdf', $fileFake); $this->assertCount(1, $project->mailings); $this->assertCount(1, $project->mailings()->first()->attachments); } /** @test */ public function when_running_the_seeder_their_are_three_projects(): void { $this->seed(); $this->assertCount(3,Project::all()); } }