makeTestData(); } /** * @test */ public function testPaymentIsPresentInLedger() { $invoice = $this->invoice->service()->markPaid()->save(); $ledger = CompanyLedger::whereClientId($invoice->client_id) ->whereCompanyId($invoice->company_id) ->orderBy('id', 'DESC') ->first(); $payment = $ledger->adjustment * -1; $this->assertEquals($invoice->amount, $payment); } /** * @test */ public function testInvoiceIsPresentInLedger() { $invoice = $this->invoice->service()->markPaid()->save(); $this->assertGreaterThan(0, $invoice->company_ledger()->count()); } }