From 15b1237e210f37806c4f7eb7cb192f0aa43c1ddf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 27 Oct 2022 12:10:11 +1100 Subject: [PATCH] Fixes for bank transaction tests --- tests/Feature/Bank/BankTransactionTest.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Bank/BankTransactionTest.php b/tests/Feature/Bank/BankTransactionTest.php index 6e78a5c45581..816bffee888c 100644 --- a/tests/Feature/Bank/BankTransactionTest.php +++ b/tests/Feature/Bank/BankTransactionTest.php @@ -12,6 +12,8 @@ namespace Tests\Feature\Bank; +use App\Factory\BankIntegrationFactory; +use App\Factory\BankTransactionFactory; use App\Models\BankTransaction; use App\Models\Invoice; use Illuminate\Foundation\Testing\DatabaseTransactions; @@ -56,8 +58,24 @@ class BankTransactionTest extends TestCase { $data = []; + $bi = BankIntegrationFactory::create($this->company->id, $this->user->id, $this->account->id); + $bi->save(); + + $bt = BankTransactionFactory::create($this->company->id, $this->user->id); + $bt->bank_integration_id = $bi->id; + $bt->description = 'Fuel'; + $bt->amount = 10; + $bt->currency_code = $this->client->currency()->code; + $bt->date = now()->format('Y-m-d'); + $bt->transaction_id = 1234567890; + $bt->category_id = 10000003; + $bt->base_type = 'DEBIT'; + $bt->save(); + + $data = []; + $data['transactions'][] = [ - 'id' => $this->bank_transaction->hashed_id, + 'id' => $bt->hashed_id, ]; $response = $this->withHeaders([