mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Test data no longer runs into the future.
This commit is contained in:
parent
cdeb1ad87c
commit
c0ea19e15e
@ -596,6 +596,7 @@ class TestDataSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
$start = clone $date;
|
$start = clone $date;
|
||||||
$end = clone $date;
|
$end = clone $date;
|
||||||
|
$today = new Carbon;
|
||||||
$start->startOfMonth();
|
$start->startOfMonth();
|
||||||
$end->endOfMonth();
|
$end->endOfMonth();
|
||||||
|
|
||||||
@ -605,7 +606,7 @@ class TestDataSeeder extends Seeder
|
|||||||
$budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]);
|
$budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]);
|
||||||
|
|
||||||
$current = clone $start;
|
$current = clone $start;
|
||||||
while ($current < $end) {
|
while ($current < $end && $current < $today) {
|
||||||
// daily groceries:
|
// daily groceries:
|
||||||
$amount = rand(1000, 2500) / 100;
|
$amount = rand(1000, 2500) / 100;
|
||||||
$toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]);
|
$toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]);
|
||||||
@ -651,10 +652,11 @@ class TestDataSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
$start = clone $date;
|
$start = clone $date;
|
||||||
$end = clone $date;
|
$end = clone $date;
|
||||||
|
$today = new Carbon;
|
||||||
$start->startOfMonth();
|
$start->startOfMonth();
|
||||||
$end->endOfMonth();
|
$end->endOfMonth();
|
||||||
$current = clone $start;
|
$current = clone $start;
|
||||||
while ($current < $end) {
|
while ($current < $end && $current < $today) {
|
||||||
|
|
||||||
// weekly drink:
|
// weekly drink:
|
||||||
$thisDate = clone $current;
|
$thisDate = clone $current;
|
||||||
|
Loading…
Reference in New Issue
Block a user