public function testGetSingleSummary() { $note = new Note(); $note->student_id = 1; $note->note = "most recent note"; $note->save(); $summary = new \Tsny\CustomObjects\StudentSummary(1); $this->assertEquals(2, count($summary->current_goals)); $this->assertEquals(1, count($summary->current_skills)); $this->assertEquals(2, count($summary->most_recent_notes)); $this->assertEquals('most recent note', $summary->most_recent_notes[0]->note); }
/** * Run the database seeds. * * @return void */ public function run() { Note::truncate(); $faker = \Faker\Factory::create(); Note::create(['student_id' => 1, 'note' => $faker->sentence()]); Note::create(['student_id' => 1, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); Note::create(['student_id' => 1, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); Note::create(['student_id' => 1, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); Note::create(['student_id' => 2, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); Note::create(['student_id' => 2, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); Note::create(['student_id' => 3, 'user_id' => rand(1, 4), 'note' => $faker->sentence()]); }