本文整理汇总了PHP中Course::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::deleteAll方法的具体用法?PHP Course::deleteAll怎么用?PHP Course::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::deleteAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
Lesson::deleteAll();
Unit::deleteAll();
Course::deleteAll();
User::deleteAll();
}
示例2: testDeleteAll
function testDeleteAll()
{
$name = "Math";
$id = 1;
$test_course = new Course($name);
$test_course->save();
$name2 = "Science";
$id2 = 2;
$test_course2 = new Course($name2);
$test_course2->save();
Course::deleteAll();
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例3: test_deleteAll
function test_deleteAll()
{
$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();
Course::deleteAll();
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例4: test_deleteAll
function test_deleteAll()
{
$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();
Course::deleteAll();
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例5: test_deleteAll
function test_deleteAll()
{
//Arrange
$name = "High Times";
$code = "CHEM420";
$test_course = new Course($name, $code);
$test_course->save();
$name2 = "Gavanese Jamelan";
$code2 = "MUSC69";
$test_course2 = new Course($name2, $code2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例6: testDeleteAll
function testDeleteAll()
{
//arrange
$course_id = 1;
$course_name = "History";
$course_number = "101";
$test_course = new Course($course_name, $course_number, $course_id);
$test_course->save();
$course_id2 = 2;
$course_name2 = "Math";
$course_number2 = "25";
$test_course2 = new Course($course_name2, $course_number2, $course_id2);
$test_course2->save();
//act
Course::deleteAll();
//assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例7: tearDown
protected function tearDown()
{
Course::deleteAll();
}
示例8: test_deleteAll
function test_deleteAll()
{
//Arrange
$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();
$title2 = "Intro to Ladders: SHOP-10";
$teacher2 = "Jeff Winger";
$time2 = "MWF 11AM-12PM";
$semester2 = "Spring";
$test_course2 = new Course($title2, $teacher2, $time2, $semester2);
$test_course2->save();
//Act
Course::deleteAll();
$result = Course::getAll();
//Assert
$this->assertEquals([], $result);
}
示例9: tearDown
protected function tearDown()
{
Course::deleteAll();
Student::deleteAll();
Department::deleteAll();
}
示例10: PDO
require_once __DIR__ . "/../src/Course.php";
$app = new Silex\Application();
$app['debug'] = true;
$server = 'mysql:host=localhost;dbname=university';
$username = 'root';
$password = 'root';
$DB = new PDO($server, $username, $password);
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
use Symfony\Component\HttpFoundation\Request;
Request::enableHttpMethodParameterOverride();
//Home
$app->get("/", function () use($app) {
return $app['twig']->render('index.html.twig');
});
$app->post("/delete_courses", function () use($app) {
Course::deleteAll();
return $app['twig']->render('index.html.twig');
});
//Courses
$app->get("/courses", function () use($app) {
return $app['twig']->render('courses.html.twig', array('courses' => Course::getAll()));
});
$app->post("/courses", function () use($app) {
$course = new Course($_POST['name'], $_POST['number']);
$course->save();
return $app['twig']->render('courses.html.twig', array('courses' => Course::getAll()));
});
$app->get("/courses/{id}", function ($id) use($app) {
$course = Course::find($id);
return $app['twig']->render('course.html.twig', array('course' => $course, 'students' => $course->getStudents(), 'all_students' => Student::getAll()));
});
示例11: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "History";
$course_number = "HIST101";
$name2 = "English";
$course_number2 = "ENG500";
$test_course = new Course($name, $course_number);
$test_course->save();
$test_course2 = new Course($name2, $course_number2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例12: testDeleteAll
function testDeleteAll()
{
//Arrange
$id = null;
$name = "Intro to Math";
$number = "MATH100";
$test_course = new Course($id, $name, $number);
$test_course->save();
$name2 = "Intro to History";
$number2 = "HIST101";
$test_course2 = new Course($id, $name2, $number2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例13: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "Biology";
$number = 101;
$id = 1;
$name2 = "Auto";
$number2 = 101;
$id2 = 2;
$test_course = new Course($name, $number, $id);
$test_course->save();
$test_course2 = new Course($name2, $number2, $id2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例14: test_deleteAll
function test_deleteAll()
{
//Arrange
$course_name = "History 110";
$id = 1;
$course_number = "HST110";
$test_course = new Course($course_name, $id, $course_number);
$test_course->save();
$course_name2 = "Math 101";
$id2 = 2;
$course_number2 = "MTH101";
$test_course2 = new Course($course_name2, $id2, $course_number2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}
示例15: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "Psychology 101";
$course_number = "2015-08-15";
$test_course = new Course($name, $course_number);
$test_course->save();
$name2 = "Psychology 102";
$course_number2 = "PSY102";
$test_course2 = new Course($name2, $course_number2);
$test_course2->save();
//Act
Course::deleteAll();
//Assert
$result = Course::getAll();
$this->assertEquals([], $result);
}