diff --git a/database/seeds/TestData.php b/app/Support/Migration/TestData.php similarity index 96% rename from database/seeds/TestData.php rename to app/Support/Migration/TestData.php index 9c2a3fe5fb..594e87334f 100644 --- a/database/seeds/TestData.php +++ b/app/Support/Migration/TestData.php @@ -1,4 +1,6 @@ 'Rent', + 'match' => 'rent,land,lord', + 'amount_min' => 795, + 'amount_max' => 805, + 'user_id' => $user->id, + 'date' => '2015-01-01', + 'active' => 1, + 'automatch' => 1, + 'repeat_freq' => 'monthly', + 'skip' => 0, + ] + ); + Bill::create( + [ + 'name' => 'Health insurance', + 'match' => 'zilveren,kruis,health', + 'amount_min' => 120, + 'amount_max' => 140, + 'user_id' => $user->id, + 'date' => '2015-01-01', + 'active' => 1, + 'automatch' => 1, + 'repeat_freq' => 'monthly', + 'skip' => 0, + ] + ); + } + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @param User $user @@ -203,48 +244,15 @@ class TestData /** @var Account $account */ foreach ($user->accounts()->get() as $account) { if ($account->name == $name) { + Log::debug('Trying to find "' . $name . '" in "' . $account->name . '", and found it!'); + return $account; - break; } + Log::debug('Trying to find "' . $name . '" in "' . $account->name . '".'); } return null; } - /** - * @param User $user - */ - public static function createBills(User $user) - { - Bill::create( - [ - 'name' => 'Rent', - 'match' => 'rent,land,lord', - 'amount_min' => 795, - 'amount_max' => 805, - 'user_id' => $user->id, - 'date' => '2015-01-01', - 'active' => 1, - 'automatch' => 1, - 'repeat_freq' => 'monthly', - 'skip' => 0, - ] - ); - Bill::create( - [ - 'name' => 'Health insurance', - 'match' => 'zilveren,kruis,health', - 'amount_min' => 120, - 'amount_max' => 140, - 'user_id' => $user->id, - 'date' => '2015-01-01', - 'active' => 1, - 'automatch' => 1, - 'repeat_freq' => 'monthly', - 'skip' => 0, - ] - ); - } - } \ No newline at end of file