当前位置: 首页>>代码示例>>PHP>>正文


PHP Course::getStudents方法代码示例

本文整理汇总了PHP中Course::getStudents方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::getStudents方法的具体用法?PHP Course::getStudents怎么用?PHP Course::getStudents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Course的用法示例。


在下文中一共展示了Course::getStudents方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetStudents

 function testGetStudents()
 {
     $name = "Mike";
     $enrollment_date = "2015-12-12";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $name2 = "The Same Exact Name";
     $enrollment_date2 = "2015-12-12";
     $test_student2 = new Student($name2, $enrollment_date2);
     $test_student2->save();
     $course_name = "Real Analysis I";
     $course_number = "Math 540";
     $test_course = new Course($course_name, $course_number);
     $test_course->save();
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:nathanhwyoung,项目名称:switched_registrar,代码行数:18,代码来源:CourseTest.php

示例2: Student

 function test_getStudents()
 {
     //Arrange
     $name = "Steve Beekman";
     $date = "2015-08-23";
     $test_student = new Student($name, $date);
     $test_student->save();
     $title = "Intro to Typing: COM-91";
     $teacher = "Ancient Raven";
     $time = "TH 9PM-11PM";
     $semester = "Fall";
     $test_course = new Course($title, $teacher, $time, $semester);
     $test_course->save();
     //Act
     $test_course->addStudent($test_student);
     $result = $test_course->getStudents();
     //Assert
     $this->assertEquals([$test_student], $result);
 }
开发者ID:jlbethel,项目名称:Registrar_test,代码行数:19,代码来源:CourseTest.php

示例3: Student

 function test_deleteAllStudents()
 {
     //Arrange
     $name = "Wesley Pong";
     $enrollment_date = "2015-09-09";
     $id = 1;
     $test_student = new Student($name, $enrollment_date, $id);
     $test_student->save();
     $name2 = "Billy Bodega";
     $enrollment_date2 = "2015-09-09";
     $id2 = 1;
     $test_student2 = new Student($name2, $enrollment_date2, $id2);
     $test_student2->save();
     $course_name = "History";
     $id2 = 2;
     $course_number = 'HIST:101';
     $test_course = new Course($course_name, $course_number, $id2);
     $test_course->save();
     $test_course->addStudent($test_student->getId());
     $test_course->addStudent($test_student2->getId());
     //Act
     $test_course->deleteAllStudents($test_student->getId());
     $result = $test_course->getStudents();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:jeffaustin81,项目名称:University_Registrar,代码行数:26,代码来源:CourseTest.php

示例4: testGetStudents

 function testGetStudents()
 {
     //Arrange
     $name = "Math";
     $course_num = "101";
     $id = 1;
     $test_course = new Course($name, $course_num, $id);
     $test_course->save();
     $name = "Rick";
     $date = "2015-08-15";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     $name2 = "Obama";
     $date2 = "2015-10-13";
     $id2 = 2;
     $test_student2 = new Student($name2, $date2, $id2);
     $test_student2->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     $result = $test_course->getStudents();
     //Assert
     $this->assertEquals([$test_student, $test_student2], $result);
 }
开发者ID:jlbethel,项目名称:Registrar-switch,代码行数:25,代码来源:CourseTest.php

示例5: Course

 function test_getStudents()
 {
     //Arrange
     $test_course = new Course("Fundamentals of Human Anatomy", "SEXY101");
     $test_course->save();
     $test_course2 = new Course("Organic Chemistry of Cannabinoids", "CHEM420");
     $test_course2->save();
     $test_student = new Student("Sarah", "2000-04-01");
     $test_student->save();
     $test_student2 = new Student("JC", "0000-12-25");
     $test_student2->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     $test_course2->addStudent($test_student);
     //Assert
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:umamiMike,项目名称:registar_epic,代码行数:18,代码来源:CourseTest.php

示例6: testAddStudent

 function testAddStudent()
 {
     $student_name = "John Doe";
     $enrollment_date = "2015-09-01";
     $test_student = new Student($student_name, $enrollment_date);
     $test_student->save();
     $course_name = "History";
     $course_code = "HIST100";
     $test_course = new Course($course_name, $course_code);
     $test_course->save();
     $test_course->addStudent($test_student);
     $this->assertEquals($test_course->getStudents(), [$test_student]);
 }
开发者ID:julianstewart,项目名称:university_registrar,代码行数:13,代码来源:CourseTest.php

示例7: Course

 function test_addStudent_and_getStudents()
 {
     $name = "Western Civ";
     $number = "HST 101";
     $test_course = new Course($name, $number);
     $test_course->save();
     $name = "Chris";
     $date = "1111-11-11";
     $test_student = new Student($name, $date);
     $test_student->save();
     $name2 = "Dillon";
     $test_student2 = new Student($name2, $date);
     $test_student2->save();
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:austinblanchard,项目名称:university_registrar_switch,代码行数:17,代码来源:CourseTest.php

示例8: testAddStudent

 function testAddStudent()
 {
     //Arrange
     $name = "History";
     $course_number = "HIST101";
     $id = 1;
     $test_course = new Course($name, $course_number, $id);
     $test_course->save();
     $student_name = "Lebowski";
     $enrollment_date = "2015-03-03";
     $id2 = 2;
     $test_student = new Student($student_name, $enrollment_date, $id2);
     $test_student->save();
     //Act
     $test_course->addStudent($test_student);
     $result = $test_course->getStudents();
     //Assert
     $this->assertEquals([$test_student], $result);
 }
开发者ID:kevintokheim,项目名称:University_Registrar2,代码行数:19,代码来源:CourseTest.php

示例9: testGetStudents

 function testGetStudents()
 {
     //Arrange
     $name = "Biology";
     $number = 101;
     $id = 1;
     $test_course = new Course($name, $id);
     $test_course->save();
     $name = "Elliot Michaels";
     $date = "2015-08-03";
     $id2 = 2;
     $test_student = new Student($name, $date, $id2);
     $test_student->save();
     $name2 = "Agatha Heterodyne";
     $date2 = "1866-04-06";
     $id3 = 3;
     $test_student2 = new Student($name2, $date2, $id3);
     $test_student2->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     //Assert
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:Camolot,项目名称:student,代码行数:24,代码来源:CourseTest.php

示例10: testGetStudents

 function testGetStudents()
 {
     //Arrange
     $id = null;
     $name = "Intro to Math";
     $number = "MATH100";
     $test_course = new Course($id, $name, $number);
     $test_course->save();
     $name2 = "Micah";
     $id2 = null;
     $enrollment_date = "2015-09-13";
     $test_student = new Student($id, $name2, $enrollment_date);
     $test_student->save();
     $name3 = "Phil";
     $id3 = null;
     $enrollment_date2 = "2015-09-03";
     $test_student2 = new Student($id3, $name3, $enrollment_date2);
     $test_student2->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     //Assert
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:kellimargaret,项目名称:University_Registrar_Part2,代码行数:24,代码来源:CourseTest.php

示例11: testGetCategories

 function testGetCategories()
 {
     //Arrange
     $date_enrolled = "2015-10-10";
     $student_name = "Ben Baker Billington";
     $student_id = 1;
     $test_student = new Student($student_name, $date_enrolled, $student_id);
     $test_student->save();
     $student_name2 = "Billy Joe Jim Bob";
     $student_id2 = 2;
     $test_student2 = new Student($student_name2, $date_enrolled, $student_id2);
     $test_student2->save();
     $course_name = "Jammin it, dude";
     $course_number = "102";
     $course_id = 3;
     $test_course = new Course($course_name, $course_number, $course_id);
     $test_course->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     //Assert
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:nathanhwyoung,项目名称:registrar,代码行数:23,代码来源:CourseTest.php

示例12: testGetStudents

 function testGetStudents()
 {
     //Arrange
     $course_name = "History";
     $id = 1;
     $course_number = "HIST101";
     $test_course = new Course($course_name, $id, $course_number);
     $test_course->save();
     $student_name2 = "Pablo";
     $enrollment_date2 = "2015-08-22";
     $id2 = 2;
     $test_student2 = new Student($student_name2, $id2, $enrollment_date2);
     $test_student2->save();
     $student_name = "Paco";
     $id3 = 3;
     $enrollment_date = "2015-06-22";
     $test_student = new Student($student_name, $id3, $enrollment_date);
     $test_student->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     //Assert
     $this->assertEquals($test_course->getStudents(), [$test_student, $test_student2]);
 }
开发者ID:kylepratuch,项目名称:registrar2,代码行数:24,代码来源:CourseTest.php

示例13: testGetStudents

 function testGetStudents()
 {
     //Arrange
     $name = "Bowling";
     $course_number = "400";
     $id = 1;
     $test_course = new Course($name, $course_number, $id);
     $test_course->save();
     $student_name = "Jeff Lebowski";
     $enrollment_date = "1989-12-12";
     $id2 = 2;
     $test_student = new Student($student_name, $enrollment_date, $id2);
     $test_student->save();
     $student_name2 = "Walter";
     $enrollment_date2 = "1888-12-12";
     $id3 = 3;
     $test_student2 = new Student($student_name2, $enrollment_date2, $id3);
     $test_student2->save();
     //Act
     $test_course->addStudent($test_student);
     $test_course->addStudent($test_student2);
     //Assert
     $this->assertEquals([$test_student, $test_student2], $test_course->getStudents());
 }
开发者ID:alexdbrown,项目名称:university_registrar,代码行数:24,代码来源:CourseTest.php

示例14: testDelete

 function testDelete()
 {
     $name = "History";
     $course_number = "HIST100";
     $test_course = new Course($name, $course_number);
     $test_course->save();
     $name = "Bob";
     $enrollment_date = "2015-01-01";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $test_course->addStudent($test_student);
     $test_course->delete();
     $this->assertEquals([], $test_course->getStudents());
 }
开发者ID:julianstewart,项目名称:university_registrar2,代码行数:14,代码来源:CourseTest.php

示例15: Course

foreach ($courses as $c) {
    echo $c->getDescription() . "\n";
    $course = $c;
}
$s->deleteCourses($course);
Hypersistence::commit();
$s->load(true);
$courses = $s->getCourses();
foreach ($courses as $c) {
    echo $c->getDescription() . "\n";
}
$c = new Course();
$c->setId(1);
$c->load();
echo $c->getDescription() . "\n";
$students = $c->getStudents();
foreach ($students as $s) {
    echo $s->getName() . "\n";
}
//SEARCH
$p = new Person();
$p->setName('Mat');
$search = $p->search();
$search->orderBy('name');
$list = $search->execute();
foreach ($list as $p) {
    echo $p->getName() . "\n";
}
//Recursive Search
$c = new City();
$c->setName('San');
开发者ID:mateusfornari,项目名称:hypersistence-alpha,代码行数:31,代码来源:index.php


注:本文中的Course::getStudents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。