From 1e7f750a1b8f48eec9694b69491a7d4aa7835365 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 19 Jan 2023 08:25:15 +1100 Subject: [PATCH] Fixes for tests --- .../Feature/Export/ProductSalesReportTest.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/Feature/Export/ProductSalesReportTest.php b/tests/Feature/Export/ProductSalesReportTest.php index 7557c53d4543..7c68648ea96f 100644 --- a/tests/Feature/Export/ProductSalesReportTest.php +++ b/tests/Feature/Export/ProductSalesReportTest.php @@ -118,6 +118,13 @@ class ProductSalesReportTest extends TestCase 'is_income_billed' => true, 'include_tax' => false, ]; + + $this->client = Client::factory()->create([ + 'user_id' => $this->user->id, + 'company_id' => $this->company->id, + 'is_deleted' => 0, + ]); + } public function testProductSalesInstance() @@ -128,29 +135,24 @@ class ProductSalesReportTest extends TestCase $this->assertInstanceOf(ProductSalesExport::class, $pl); - // $this->account->delete(); + $this->account->delete(); } public function testSimpleReport() { $this->buildData(); - $client = Client::factory()->create([ - 'user_id' => $this->user->id, - 'company_id' => $this->company->id, - 'is_deleted' => 0, - ]); $this->payload = [ 'start_date' => '2000-01-01', 'end_date' => '2030-01-11', 'date_range' => 'custom', - 'client_id' => $client->id, + 'client_id' => $this->client->id, 'report_keys' => [] ]; $i = Invoice::factory()->create([ - 'client_id' => $client->id, + 'client_id' => $this->client->id, 'user_id' => $this->user->id, 'company_id' => $this->company->id, 'amount' => 0,