Add sample tests. Change userUid argument to be properly userId. Do some safe checks in search.

This commit is contained in:
Taylor Dondich
2019-05-01 13:49:05 -07:00
committed by Paula Quispe
parent 9fa4c1750a
commit 17e6ef3441
3 changed files with 116 additions and 30 deletions

View File

@@ -7,7 +7,14 @@ $factory->define(\ProcessMaker\Model\Delegation::class, function(Faker $faker) {
$app = factory(\ProcessMaker\Model\Application::class)->create();
$process = \ProcessMaker\Model\Process::where('PRO_UID', $app->PRO_UID)->first();
$task = $process->tasks->first();
$user = \ProcessMaker\Model\User::all()->random();
// Grab a user if random
$users = \ProcessMaker\Model\User::all();
if(!count($users)) {
$user = factory(\ProcessMaker\Model\User::class)->create();
} else{
$user = $users->random();
}
return [
'APP_UID' => $app->APP_UID,
'DEL_INDEX' => 1,