/** * Run the database seeds. * * @return void */ public function run() { $projectdetails = ['name' => 'shitzu', 'description' => 'frickzena oah auhsdoh vgos']; $taskdetails = ['name' => 'joozie', 'description' => 'ahioihd poaiy7u ascihogyfcd pouaou']; $taskdetails2 = ['name' => 'ambroze', 'description' => 'shitzu prickzen la frickzen']; $statusdetails = ['message' => 'hello wazzup?']; DB::table('projects')->delete(); DB::table('users_projects')->delete(); DB::table('stories')->delete(); DB::table('sprints')->delete(); DB::table('backlogs')->delete(); // optional DB::table('comments')->delete(); DB::table('statuses')->delete(); $user1 = User::firstOrFail(); $user2 = User::all()->last(); $project = Bus::dispatch(new CreateProject($user1, $projectdetails)); Bus::dispatch(new AddUserToProject($user1, $project, $user2, 'developer')); $users = User::whereIn('id', [$user1->id, $user2->id])->get(); $backlog = App\Backlog::create(['name' => 'Release Elixir']); $user1->backlogs()->save($backlog); $project->backlogs()->save($backlog); $sprint = App\Sprint::create(['name' => 'Sprint Shikku']); $project->sprints()->save($sprint); $backlog->sprints()->save($sprint); $user1->sprints()->save($sprint); $datas = [['name' => 'Refactoring Iceblocks', 'description' => 'Cool tasks are always cool. So do this !!', 'priority' => 1, 'work_hours' => '7'], ['name' => 'Streaming section', 'description' => 'This is one of the besttask ever i ve seen in my life time => )', 'priority' => 0, 'work_hours' => '2'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2']]; foreach ($datas as $data) { $story = App\Story::create($data); $project->stories()->save($story); $user1->createdStories()->save($story); } }
public function queueTest() { $Collection = \Illuminate\Support\Collection::make(['0 . ', '1 . ', '2 . ', '3 . ', '4 . ']); foreach (range(0, 2) as $v) { $message = \Illuminate\Foundation\Inspiring::quote(); $job = (new \App\Jobs\PushMessage(1, $Collection->get($v)))->delay(20 * $v); \Bus::dispatch($job); } $job = (new \App\Jobs\PushMessage(1, $Collection->get(3), 1))->delay(20 * ($v + 1)); \Bus::dispatch($job); }
break; case 'SIX': $goals = 6; break; default: $goals = 0; break; } $bForm = (object) ['formid' => 'SpEd 6b', 'title' => 'SpEd 6b', 'responses' => [(object) ['field' => 'date-of-iep', 'type' => 'text', 'response' => $responses->get('date-of-iep')], (object) ['field' => 'correlate-with-transition-plan', 'type' => 'text', 'response' => $responses->get('correlate-with-transition-plan')]]]; $cForm = (object) ['formid' => 'SpEd 6c', 'title' => 'SpEd 6c', 'responses' => [(object) ['field' => 'goal-amount', 'type' => 'text', 'response' => $goals], (object) ['field' => 'date-of-iep', 'type' => 'text', 'response' => $responses->get('date-of-iep')]]]; if ($goals > 0) { for ($i = 1; $i <= $goals; $i++) { $cForm->responses[] = (object) ['field' => "goal{$i}-description", 'type' => 'text', 'response' => $responses->get("goal{$i}-description")]; $cForm->responses[] = (object) ['field' => "goal{$i}-measured", 'type' => 'checkbox', 'response' => $responses->get("goal{$i}-measured")]; $cForm->responses[] = (object) ['field' => "goal{$i}-measured-other", 'type' => 'text', 'response' => $responses->get("goal{$i}-measured-other")]; $cForm->responses[] = (object) ['field' => "goal{$i}-report", 'type' => 'checkbox', 'response' => $responses->get("goal{$i}-report")]; $cForm->responses[] = (object) ['field' => "goal{$i}-report-other", 'type' => 'text', 'response' => $responses->get("goal{$i}-report-other")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date1", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date1")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code1", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code1")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date2", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date2")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code2", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code2")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date3", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date3")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code3", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code3")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date4", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date4")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code4", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code4")]; $cForm->responses[] = (object) ['field' => "goal{$i}-short-term-objectives", 'type' => 'text', 'response' => $responses->get("goal{$i}-short-term-objectives")]; } } $files[] = Bus::dispatch(new App\Iep\Legacy\Commands\FillPdfCommand($student, json_encode([$bForm]), $event->fileOption, $event->watermarkOption))['file']; $files[] = Bus::dispatch(new App\Iep\Legacy\Commands\FillPdfCommand($student, json_encode([$cForm]), $event->fileOption, $event->watermarkOption))['file']; echo json_encode($files);
public function testTaskOwnership() { $project = Project::has('users', '>', 1)->first(); $user1 = $project->users()->wherePrivilegeLevel('1')->first(); $user2 = $project->users()->where('id', '!=', $user1->id)->first(); // echo "users {$user1->id} {$user2->id}"; $users = User::whereIn('id', [$user1->id, $user2->id])->get(); $this->assertNotNull($users); $this->assertEquals(2, $users->count()); $task = Bus::dispatch(new CreateTask($user1, ['name' => 'poopech'], $project, null, $users)); $this->assertTrue($task->users->contains($user1->id)); $this->assertTrue($task->users->contains($user2->id)); }
public function stestJoinChat() { $user = User::firstOrFail(); $chat = Chat::create($this->chatroomdata); $action = Bus::dispatch(new JoinChat($user, $chat)); // add $this->assertNull($action->admin); $this->assertTrue($chat->users->contains($user->id)); $this->assertEquals(1, $chat->messages->count()); $this->assertEquals(1, $chat->users->count()); $action = Bus::dispatch(new LeaveChat($user, $chat)); // remove $this->assertEquals(2, Message::count()); // $this->assertEquals(0, $chat->users->count()); $admin = User::all()->last(); $this->assertNotNull($admin); $this->assertNotEquals($admin->id, $user->id); $action = Bus::dispatch(new JoinChat($user, $chat, $admin)); // add $this->assertEquals($action->admin->id, $admin->id); $action = Bus::dispatch(new LeaveChat($user, $chat, $admin)); // remove }