mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Lots of new code to test the import routine.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -244,6 +244,26 @@ class TestData
|
||||
DB::table('categories')->insert($insert);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function createImportJobs()
|
||||
{
|
||||
$insert = [];
|
||||
foreach ($this->data['import-jobs'] as $job) {
|
||||
$insert[] = [
|
||||
'created_at' => $this->time,
|
||||
'updated_at' => $this->time,
|
||||
'user_id' => $job['user_id'],
|
||||
'file_type' => $job['file_type'],
|
||||
'key' => $job['key'],
|
||||
'status' => $job['status'],
|
||||
'configuration' => json_encode($job['configuration']),
|
||||
];
|
||||
}
|
||||
DB::table('import_jobs')->insert($insert);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -640,14 +660,14 @@ class TestData
|
||||
foreach ($this->data['piggy-banks'] as $piggyBank) {
|
||||
$piggyId = DB::table('piggy_banks')->insertGetId(
|
||||
[
|
||||
'created_at' => $this->time,
|
||||
'updated_at' => $this->time,
|
||||
'account_id' => $piggyBank['account_id'],
|
||||
'name' => Crypt::encrypt($piggyBank['name']),
|
||||
'targetamount' => $piggyBank['targetamount'],
|
||||
'startdate' => $piggyBank['startdate'],
|
||||
'order' => $piggyBank['order'],
|
||||
'encrypted' => 1,
|
||||
'created_at' => $this->time,
|
||||
'updated_at' => $this->time,
|
||||
'account_id' => $piggyBank['account_id'],
|
||||
'name' => Crypt::encrypt($piggyBank['name']),
|
||||
'targetamount' => $piggyBank['targetamount'],
|
||||
'startdate' => $piggyBank['startdate'],
|
||||
'order' => $piggyBank['order'],
|
||||
'encrypted' => 1,
|
||||
]
|
||||
);
|
||||
if (isset($piggyBank['currentamount'])) {
|
||||
@@ -808,6 +828,7 @@ class TestData
|
||||
$this->createMultiWithdrawals();
|
||||
$this->createMultiDeposits();
|
||||
$this->createMultiTransfers();
|
||||
$this->createImportJobs();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user