firefly-iii/app/tests/factories/PiggyBank.php

39 lines
1.4 KiB
PHP
Raw Normal View History

2015-01-01 06:12:05 -06:00
<?php
League\FactoryMuffin\Facade::define(
'PiggyBank', [
'account_id' => 'factory|Account',
'name' => 'word',
2015-01-01 15:53:03 -06:00
'targetamount' => function () {
return rand(1, 400);
},
2015-01-01 06:12:05 -06:00
'startdate' => 'date|Y-m-d',
'targetdate' => 'date|Y-m-d',
'repeats' => 'boolean',
'rep_length' => function () {
$set = ['day', 'week', 'quarter', 'month', 'year'];
return $set[rand(0, count($set) - 1)];
},
'rep_every' => function () {
return rand(0, 3);
},
'rep_times' => function () {
return rand(0, 3);
},
2015-01-01 06:12:05 -06:00
'reminder' => function () {
$set = ['day', 'week', 'quarter', 'month', 'year'];
return $set[rand(0, count($set) - 1)];
},
2015-01-01 15:53:03 -06:00
'reminder_skip' => function () {
return rand(0, 3);
},
2015-01-01 06:12:05 -06:00
'remind_me' => 'boolean',
2015-01-01 15:53:03 -06:00
'order' => function () {
return rand(0, 10);
},
2015-01-01 06:12:05 -06:00
]
);