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


PHP Student::getAll方法代碼示例

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


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

示例1: test_save

 function test_save()
 {
     //Arrange
     $name = "Joleen";
     $enrollment = "2015-09-18";
     $test_student = new Student($name, $enrollment);
     $test_student->save();
     //Act
     $result = Student::getAll();
     //Assert
     $this->assertEquals($test_student, $result[0]);
 }
開發者ID:kellimargaret,項目名稱:University_Registrar,代碼行數:12,代碼來源:StudentTest.php

示例2: find

 static function find($search_id)
 {
     $found_student = null;
     $students = Student::getAll();
     foreach ($students as $student) {
         $student_id = $student->getId();
         if ($student_id == $search_id) {
             $found_student = $student;
         }
     }
     return $found_student;
 }
開發者ID:nathanhwyoung,項目名稱:switched_registrar,代碼行數:12,代碼來源:Student.php

示例3: test_deleteOne

 function test_deleteOne()
 {
     $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_student->deleteOne();
     $this->assertEquals(Student::getAll(), [$test_student2]);
 }
開發者ID:austinblanchard,項目名稱:university_registrar_switch,代碼行數:12,代碼來源:StudentTest.php

示例4: testSave

 function testSave()
 {
     //Arrange
     $student_name = "Johnny Mcfly";
     $date_enrollment = "12-12-2012";
     $test_student = new Student($student_name, $date_enrollment);
     //Act
     $test_student->save();
     //Assert
     $result = Student::getAll();
     $this->assertEquals($test_student, $result[0]);
 }
開發者ID:sammartinez,項目名稱:registar_epic,代碼行數:12,代碼來源:StudentTest.php

示例5: testGetAll

 function testGetAll()
 {
     $name = "Bob";
     $enrollment_date = "2015-01-01";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $name2 = "Kevin";
     $enrollment_date2 = "2015-02-01";
     $test_student2 = new Student($name, $enrollment_date);
     $test_student2->save();
     $result = Student::getAll();
     $this->assertEquals([$test_student, $test_student2], $result);
 }
開發者ID:julianstewart,項目名稱:university_registrar2,代碼行數:13,代碼來源:StudentTest.php

示例6: testSave

 function testSave()
 {
     //Arrange
     $student_id = 1;
     $student_name = "History";
     $date_enrolled = "2015-12-12";
     $test_student = new Student($student_name, $date_enrolled);
     //Act
     $test_student->save();
     //Assert
     $result = Student::getAll();
     $this->assertEquals($test_student, $result[0]);
 }
開發者ID:juliocesardiaz,項目名稱:UniRegisSwitch,代碼行數:13,代碼來源:StudentTest.php

示例7: testSave

 function testSave()
 {
     //Arrange
     $student_name = "Mike Laser";
     $date_enrollment = "2014-08-15";
     $id = 3;
     $test_student = new Student($student_name, $date_enrollment, $id);
     //Act
     $test_student->save();
     //Assert
     $result = Student::getAll();
     $this->assertEquals($test_student, $result[0]);
 }
開發者ID:bencasalino,項目名稱:registrar-afternoon,代碼行數:13,代碼來源:StudentTest.php

示例8: test_DeleteAll

 function test_DeleteAll()
 {
     //Arrange
     $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();
     Student::deleteAll();
     $result = Student::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:nathanhwyoung,項目名稱:switched_registrar,代碼行數:15,代碼來源:StudentTest.php

示例9: testDeleteStudent

 function testDeleteStudent()
 {
     //Arrange
     $name = "Elliot Michaels";
     $date = "2015-08-03";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     $name2 = "Drake Michaels";
     $date2 = "2011-02-02";
     $id2 = 2;
     $test_student2 = new Student($name2, $date2, $id2);
     $test_student2->save();
     //Act
     $test_student->delete();
     //Assert
     $this->assertEquals([$test_student2], Student::getAll());
 }
開發者ID:jtorrespdx,項目名稱:univ2,代碼行數:18,代碼來源:StudentTest.php

示例10: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $name = "Steve Beekman";
     $date = "2015-08-23";
     $test_student = new Student($name, $date);
     $test_student->save();
     $name2 = "Fred Flintstone";
     $date2 = "0001-01-01";
     $test_student2 = new Student($name2, $date2);
     $test_student2->save();
     //Act
     Student::deleteAll();
     $result = Student::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:jlbethel,項目名稱:Registrar_test,代碼行數:17,代碼來源:StudentTest.php

示例11: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $name = "Bob";
     $date_of_enrollment = "2015-08-15";
     $test_student = new Student($name, $date_of_enrollment);
     $test_student->save();
     $name2 = "Jackie";
     $date_of_enrollment2 = "2015-09-16";
     $test_student2 = new Student($name2, $date_of_enrollment2);
     $test_student2->save();
     //Act
     Student::deleteAll();
     //Assert
     $result = Student::getAll();
     $this->assertEquals([], $result);
 }
開發者ID:jeffaustin81,項目名稱:University_Registrar_Continued,代碼行數:17,代碼來源:StudentTest.php

示例12: array

    Course::deleteAll();
    return $app['twig']->render("courses.html.twig", array("courses" => Course::getAll()));
});
/////////
////////// STUDENTS
////////
$app->get("/students", function () use($app) {
    return $app['twig']->render("students.html.twig", array("students" => Student::getAll()));
});
$app->get("/students/{id}", function ($id) use($app) {
    $student = Student::find($id);
    return $app['twig']->render("student.html.twig", array("student" => $student, "courses" => $student->getCourses(), "all_courses" => Course::getAll()));
});
$app->post("/students", function () use($app) {
    $name = $_POST['name'];
    $enrollment_date = $_POST['enrollment_date'];
    $new_student = new Student($name, $enrollment_date);
    $new_student->save();
    return $app['twig']->render("students.html.twig", array("students" => Student::getAll()));
});
$app->post("/add_courses", function () use($app) {
    $course = Course::find($_POST["course_id"]);
    $course->addStudent($_POST["student_id"]);
    $student = Student::find($_POST["student_id"]);
    return $app['twig']->render("student.html.twig", array("student" => $student, "courses" => $student->getCourses(), "all_courses" => Course::getAll()));
});
$app->post("/delete_students", function () use($app) {
    Student::deleteAll();
    return $app['twig']->render("students.html.twig", array("students" => Student::getAll()));
});
return $app;
開發者ID:jeffaustin81,項目名稱:University_Registrar,代碼行數:31,代碼來源:app.php

示例13: test_deleteStudent

 function test_deleteStudent()
 {
     //Arrange
     $student_name = "Joker";
     $enrollment_date = "6000-12-14";
     $id = 1;
     $student = new Student($student_name, $enrollment_date, $id);
     $student->save();
     $student_name2 = "Riddler";
     $enrollment_date2 = "7000-08-09";
     $id2 = 2;
     $student2 = new Student($student_name2, $enrollment_date2, $id2);
     $student2->save();
     //Act
     $student->delete();
     //Assert
     $this->assertEquals([$student2], Student::getAll());
 }
開發者ID:kevintokheim,項目名稱:University_Registrar,代碼行數:18,代碼來源:StudentTest.php

示例14: test_delete

 function test_delete()
 {
     //Arrange
     $test_department = new Department("Biology", "346 Stupid Avenue");
     $test_department->save();
     $name = "Ashlin Aronin";
     $enrollment_date = "2015-08-24";
     $test_student = new Student($name, $enrollment_date, $test_department->getId());
     $test_student->save();
     $name2 = "John Nolastname";
     $enrollment_date2 = "2015-07-20";
     $test_student2 = new Student($name, $enrollment_date, $test_department->getId());
     $test_student2->save();
     //Act
     $test_student->delete();
     //Assert
     $result = Student::getAll();
     $this->assertEquals([$test_student2], $result);
 }
開發者ID:ashlinaronin,項目名稱:back2school_fam,代碼行數:19,代碼來源:StudentTest.php

示例15: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $student_name = "Bob";
     $enroll_date = "2012-10-20";
     $id = null;
     $test_student = new Student($student_name, $enroll_date, $id);
     $test_student->save();
     $student_name2 = "Sue";
     $enroll_date2 = "2013-09-09";
     $test_student2 = new Student($student_name2, $enroll_date2, $id);
     $test_student2->save();
     //Act
     Student::deleteAll();
     $result = Student::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:kylepratuch,項目名稱:registrar,代碼行數:18,代碼來源:StudentTest.php


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