Fixes for tests

This commit is contained in:
David Bomba
2026-01-23 08:48:08 +11:00
parent 5f1e201998
commit a8dfd3cbf7

View File

@@ -43,6 +43,7 @@ class CreditBalanceTest extends TestCase
'company_id' => $this->company->id,
'client_id' => $this->client->id,
'balance' => 10,
'due_date' => null,
'number' => 'testing-number-01',
'status_id' => Credit::STATUS_SENT,
]);
@@ -50,6 +51,22 @@ class CreditBalanceTest extends TestCase
$this->assertEquals($this->client->service()->getCreditBalance(), 10);
}
public function testCreditBalance2()
{
$credit = Credit::factory()->create([
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'client_id' => $this->client->id,
'balance' => 10,
'due_date' => now()->addDays(10),
'number' => 'testing-number-01',
'status_id' => Credit::STATUS_SENT,
]);
$this->assertEquals($this->client->service()->getCreditBalance(), 10);
}
public function testExpiredCreditBalance()
{
$credit = Credit::factory()->create([
@@ -57,7 +74,7 @@ class CreditBalanceTest extends TestCase
'company_id' => $this->company->id,
'client_id' => $this->client->id,
'balance' => 10,
'due_date' => now()->addDays(5),
'due_date' => now()->subDays(5),
'number' => 'testing-number-02',
'status_id' => Credit::STATUS_SENT,
]);