当前位置: 首页>>代码示例>>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;未经允许,请勿转载。