makeTestData(); $this->withoutMiddleware( ThrottleRequests::class ); } public function testMatchingBankTransactionExpense() { // $this->expense->public_notes = "WaLLaBy"; // $this->expense->save(); // $this->assertEquals('WaLLaBy', $this->expense->public_notes); $br = BankTransactionRule::factory()->create([ 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'matches_on_all' => false, 'auto_convert' => true, 'applies_to' => 'DEBIT', 'client_id' => $this->client->id, 'vendor_id' => $this->vendor->id, 'rules' => [ [ 'search_key' => 'description', 'operator' => 'is', 'value' => 'wallaby', ] ] ]); $bi = BankIntegration::factory()->create([ 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'account_id' => $this->account->id, ]); $bt = BankTransaction::factory()->create([ 'bank_integration_id' => $bi->id, 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'description' => 'WallABy', 'base_type' => 'DEBIT', ]); $bt->service()->processRules(); $bt = $bt->fresh(); $this->assertNotNull($bt->expense_id); } }