Fix tests.

This commit is contained in:
James Cole
2018-08-17 06:45:57 +02:00
parent df0e2dd2a2
commit f319005357
11 changed files with 46 additions and 70 deletions

View File

@@ -152,9 +152,9 @@ class AvailableBudgetController extends Controller
public function store(AvailableBudgetRequest $request): JsonResponse
{
$data = $request->getAll();
$currency = $this->currencyRepository->findNull($data['transaction_currency_id']);
$currency = $this->currencyRepository->findNull($data['currency_id']);
if (null === $currency) {
$this->currencyRepository->findByCodeNull($data['transaction_currency_code']);
$this->currencyRepository->findByCodeNull($data['currency_code']);
}
if (null === $currency) {
throw new FireflyException('Could not find the indicated currency.');

View File

@@ -47,11 +47,11 @@ class AvailableBudgetRequest extends Request
public function getAll(): array
{
return [
'transaction_currency_id' => $this->integer('currency_id'),
'transaction_currency_code' => $this->string('currency_code'),
'amount' => $this->string('amount'),
'start_date' => $this->date('start_date'),
'end_date' => $this->date('end_date'),
'currency_id' => $this->integer('currency_id'),
'currency_code' => $this->string('currency_code'),
'amount' => $this->string('amount'),
'start_date' => $this->date('start_date'),
'end_date' => $this->date('end_date'),
];
}

View File

@@ -51,8 +51,8 @@ class AccountDestroyService
DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
// also update recurring transactions:
DB::table('recurrences_transactions')->where('source_id', $account->id)->update(['source_id', $moveTo->id]);
DB::table('recurrences_transactions')->where('destination_id', $account->id)->update(['destination_id', $moveTo->id]);
DB::table('recurrences_transactions')->where('source_id', $account->id)->update(['source_id' => $moveTo->id]);
DB::table('recurrences_transactions')->where('destination_id', $account->id)->update(['destination_id' => $moveTo->id]);
}
$service = app(JournalDestroyService::class);

View File

@@ -68,7 +68,6 @@ class StageNewHandler
$config = $this->repository->getConfiguration($this->importJob);
$config['accounts'] = $accounts;
$this->repository->setConfiguration($this->importJob, $config);
return;
}
throw new FireflyException('The bunq API context is unexpectedly empty.'); // @codeCoverageIgnore