Example #1
0
 function testGetCourses()
 {
     $name = "John Doe";
     $password = "******";
     $email = "*****@*****.**";
     $signed_in = 0;
     $test_user = new User($name, $password, $email, $signed_in);
     $test_user->save();
     $name2 = "Jane Boe";
     $password2 = "wordpass";
     $email2 = "*****@*****.**";
     $signed_in2 = 0;
     $test_user2 = new User($name2, $password2, $email2, $signed_in2);
     $test_user2->save();
     $title = "Literature";
     $subject = "English";
     $description = "Deconstructing English literature.";
     $user_id = $test_user->getId();
     $test_course = new Course($title, $subject, $description, $user_id);
     $test_course->save();
     $title2 = "Algebra";
     $subject2 = "Math";
     $description2 = "Introduction to algebraic equations.";
     $user_id2 = $test_user2->getId();
     $test_course2 = new Course($title2, $subject2, $description2, $user_id2);
     $test_course2->save();
     $result = $test_user->getCourses();
     $this->assertEquals($test_course, $result[0]);
 }