Test data no longer runs into the future.

This commit is contained in:
James Cole 2015-07-19 09:37:52 +02:00
parent cdeb1ad87c
commit c0ea19e15e

View File

@ -596,6 +596,7 @@ class TestDataSeeder extends Seeder
{
$start = clone $date;
$end = clone $date;
$today = new Carbon;
$start->startOfMonth();
$end->endOfMonth();
@ -605,7 +606,7 @@ class TestDataSeeder extends Seeder
$budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]);
$current = clone $start;
while ($current < $end) {
while ($current < $end && $current < $today) {
// daily groceries:
$amount = rand(1000, 2500) / 100;
$toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]);
@ -651,10 +652,11 @@ class TestDataSeeder extends Seeder
{
$start = clone $date;
$end = clone $date;
$today = new Carbon;
$start->startOfMonth();
$end->endOfMonth();
$current = clone $start;
while ($current < $end) {
while ($current < $end && $current < $today) {
// weekly drink:
$thisDate = clone $current;