public static function run() { $class = get_called_class(); TEST($class, "{$class}.construct", function ($class) { $data = ['education' => [['school' => 'Yale University', 'class' => '2017', 'degree' => 'BS', 'dates' => ['start' => strtotime('August 2013')]]], 'experience' => [['title' => 'Intern', 'company' => 'Random Company', 'dates' => ['start' => strtotime('March 2017')]]], 'extracurriculars' => [['title' => 'Captain', 'organization' => 'Random Club', 'dates' => ['start' => strtotime('April 2012')]]], 'awards' => [['name' => 'random award']], 'projects' => [['name' => 'Random Project']]]; $studentId = new MongoId(); $student = new StudentProfile($studentId, $data); EQ($studentId, $student->getStudentId()); EQ(null, $student->getEducation(1)); $education = $student->getEducation(0); $educationStart = $education['dates']['start']->toDateTime()->getTimeStamp(); EQ(strtotime('August 2013'), $educationStart); }); }