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)); } 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')); } }