コード例 #1
0
 function test_deleteOne()
 {
     $name = "Western Civ";
     $number = "HST 101";
     $test_course = new Course($name, $number);
     $test_course->save();
     $name2 = "Remedial Math";
     $number2 = "MTH 64";
     $test_course2 = new Course($name2, $number2);
     $test_course2->save();
     $test_course->deleteOne();
     $this->assertEquals(Course::getAll(), [$test_course2]);
 }
コード例 #2
0
 function test_deleteOne()
 {
     $course_name = "History";
     $course_number = "HIST 101";
     $test_course = new Course($course_name, $course_number);
     $test_course->save();
     $course_name2 = "Biology";
     $course_number2 = "BIO 101";
     $test_course2 = new Course($course_name2, $course_number2);
     $test_course2->save();
     $test_course->deleteOne();
     $this->assertEquals([$test_course2], Course::getAll());
 }
コード例 #3
0
 function testDeleteCourse()
 {
     //Arrange
     $course_name = "Economics";
     $id = 1;
     $crn = "ECON101";
     $test_course = new Course($course_name, $crn, $id);
     $test_course->save();
     $course_name2 = "History";
     $id2 = 2;
     $crn2 = "HIST101";
     $test_course2 = new Course($course_name, $crn2, $id2);
     $test_course2->save();
     //Act
     $test_course->deleteOne();
     //Assert
     $this->assertEquals([$test_course2], Course::getAll());
 }
コード例 #4
0
ファイル: CourseTest.php プロジェクト: kylepratuch/registrar2
 function testDelete()
 {
     //Arrange
     $course_name = "History";
     $id = 1;
     $course_number = "HIST101";
     $test_course = new Course($course_name, $id, $course_number);
     $test_course->save();
     $student_name = "Paco";
     $id2 = 2;
     $enrollment_date = "2015-05-11";
     $test_student = new Student($student_name, $id2, $enrollment_date);
     $test_student->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->deleteOne();
     //Assert
     $this->assertEquals([], $test_student->getCourses());
 }