Lots of new code to test the import routine.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-08-11 10:21:32 +02:00
parent efe9933721
commit 186b704509
27 changed files with 1315 additions and 67 deletions

View File

@@ -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();
}
}