From 172a563535247aac60ef718c4b33752c2b47b2e6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 27 Apr 2023 10:40:57 +1000 Subject: [PATCH] Silence broadcasters --- tests/Unit/LateFeeTest.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/Unit/LateFeeTest.php b/tests/Unit/LateFeeTest.php index 8c80584066c0..739829af6c32 100644 --- a/tests/Unit/LateFeeTest.php +++ b/tests/Unit/LateFeeTest.php @@ -77,12 +77,14 @@ class LateFeeTest extends TestCase $settings = new \stdClass; $settings->currency_id = '1'; - $this->client = Client::factory()->create([ + $client = Client::factory()->create([ 'user_id' => $this->user->id, 'company_id' => $this->company->id, 'is_deleted' => 0, 'settings' => $settings, ]); + + return $client; } public function testLateFeeAdded() @@ -98,10 +100,10 @@ class LateFeeTest extends TestCase $settings->num_days_reminder1 = 10; $settings->schedule_reminder1 = 'after_due_date'; - $this->buildData($settings); + $client = $this->buildData($settings); $i = Invoice::factory()->create([ - 'client_id' => $this->client->id, + 'client_id' => $client->id, 'user_id' => $this->user->id, 'company_id' => $this->company->id, 'amount' => 0, @@ -126,6 +128,7 @@ class LateFeeTest extends TestCase $i->service()->applyNumber()->createInvitations()->save(); $this->assertEquals(10, $i->amount); + $this->assertEquals(10, $i->balance); $reflectionMethod = new \ReflectionMethod(ReminderJob::class, 'sendReminderForInvoice'); $reflectionMethod->setAccessible(true); @@ -137,7 +140,7 @@ class LateFeeTest extends TestCase } - public function testLateFeeAddedToNewInvoiceWithLockedInvoiceConfi() + public function testLateFeeAddedToNewInvoiceWithLockedInvoiceConfig() { $settings = CompanySettings::defaults(); @@ -150,10 +153,10 @@ class LateFeeTest extends TestCase $settings->num_days_reminder1 = 10; $settings->schedule_reminder1 = 'after_due_date'; - $this->buildData($settings); + $client = $this->buildData($settings); $i = Invoice::factory()->create([ - 'client_id' => $this->client->id, + 'client_id' => $client->id, 'user_id' => $this->user->id, 'company_id' => $this->company->id, 'amount' => 0,