當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Course::deleteOne方法代碼示例

本文整理匯總了PHP中Course::deleteOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP Course::deleteOne方法的具體用法?PHP Course::deleteOne怎麽用?PHP Course::deleteOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Course的用法示例。


在下文中一共展示了Course::deleteOne方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Course

 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]);
 }
開發者ID:austinblanchard,項目名稱:university_registrar_switch,代碼行數:13,代碼來源:CourseTest.php

示例2: Course

 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());
 }
開發者ID:CharlesAMoss,項目名稱:epic_Registrar_part2,代碼行數:13,代碼來源:CourseTest.php

示例3: testDeleteCourse

 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());
 }
開發者ID:kennygrage,項目名稱:epicUniversityFromPartners,代碼行數:18,代碼來源:CourseTest.php

示例4: testDelete

 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());
 }
開發者ID:kylepratuch,項目名稱:registrar2,代碼行數:19,代碼來源:CourseTest.php


注:本文中的Course::deleteOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。