mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-11 04:44:46 +00:00
Improve test coverage.
This commit is contained in:
@@ -222,6 +222,7 @@ abstract class TestCase extends BaseTestCase
|
||||
return [
|
||||
'transaction_group_id' => $withdrawal->transaction_group_id,
|
||||
'transaction_journal_id' => $withdrawal->id,
|
||||
'id' => $withdrawal->id,
|
||||
'transaction_type_type' => 'Withdrawal',
|
||||
'currency_id' => $euro->id,
|
||||
'foreign_currency_id' => null,
|
||||
@@ -241,6 +242,47 @@ abstract class TestCase extends BaseTestCase
|
||||
'budget_name' => $budget->name,
|
||||
'category_id' => $category->id,
|
||||
'category_name' => $category->name,
|
||||
'tags' => ['a', 'b', 'c'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getRandomDepositAsArray(): array
|
||||
{
|
||||
$deposit = $this->getRandomDeposit();
|
||||
$euro = $this->getEuro();
|
||||
$category = $this->getRandomCategory();
|
||||
$revenue = $this->getRandomRevenue();
|
||||
$asset = $this->getRandomAsset();
|
||||
try {
|
||||
$date = new Carbon;
|
||||
} catch (Exception $e) {
|
||||
$e->getMessage();
|
||||
}
|
||||
|
||||
return [
|
||||
'transaction_group_id' => $deposit->transaction_group_id,
|
||||
'transaction_journal_id' => $deposit->id,
|
||||
'transaction_type_type' => 'Deposit',
|
||||
'currency_id' => $euro->id,
|
||||
'foreign_currency_id' => null,
|
||||
'date' => $date,
|
||||
'description' => sprintf('I am descr #%d', $this->randomInt()),
|
||||
'source_account_id' => $revenue->id,
|
||||
'source_account_name' => $revenue->name,
|
||||
'foreign_amount' => null,
|
||||
'destination_account_id' => $asset->id,
|
||||
'destination_account_name' => $asset->name,
|
||||
'currency_name' => $euro->name,
|
||||
'currency_code' => $euro->code,
|
||||
'currency_symbol' => $euro->symbol,
|
||||
|
||||
'currency_decimal_places' => $euro->decimal_places,
|
||||
'amount' => '-30',
|
||||
'category_id' => $category->id,
|
||||
'category_name' => $category->name,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user