makeTestData(); $this->invoice->line_items = $this->buildLineItems(); $this->invoice_calc = new InvoiceSum($this->invoice); } public function testEntityNameResolution() { $entity_type = $this->invoice->getEntityType(); $this->assertEquals('Invoice', class_basename($entity_type)); $invitation = $this->invoice->invitations->first(); $entity_type = $invitation->getEntityType(); $this->assertEquals('InvoiceInvitation', class_basename($entity_type)); $this->assertEquals('InvoiceInvitation', class_basename($invitation)); $this->invoice->forceDelete(); } public function testDocumentRelationExists() { $this->assertTrue(method_exists(Invoice::class, 'documents')); $this->assertTrue(method_exists(Quote::class, 'documents')); $this->assertTrue(method_exists(Credit::class, 'documents')); $this->assertTrue(method_exists(PurchaseOrder::class, 'documents')); $this->assertTrue(method_exists(Client::class, 'documents')); $this->assertTrue(method_exists(Vendor::class, 'documents')); $this->assertTrue(method_exists(Product::class, 'documents')); $this->assertTrue(method_exists(Payment::class, 'documents')); $this->assertTrue(method_exists(Expense::class, 'documents')); $this->assertTrue(method_exists(Project::class, 'documents')); $this->assertTrue(method_exists(Task::class, 'documents')); } protected function tearDown(): void { // $this->company->company_users->each(function ($company_user) { // $company_user->user->forceDelete(); // $company_user->forceDelete(); // }); // // Clean up any resources or reset state if necessary // $this->account->delete(); parent::tearDown(); } }