Minor changes in unit tests
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.com //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
|
||||
@@ -361,7 +361,7 @@ class grade_item_test extends grade_test {
|
||||
$this->assertFalse(empty($grade_item->locked));
|
||||
$this->assertFalse(empty($grade->locked)); // individual grades should be locked too
|
||||
|
||||
$this->assertTrue($grade_item->set_locked(false));
|
||||
$this->assertTrue($grade_item->set_locked(false, true));
|
||||
$grade = new grade_grade($grade_item->get_final(1));
|
||||
|
||||
$this->assertTrue(empty($grade_item->locked));
|
||||
@@ -390,7 +390,7 @@ class grade_item_test extends grade_test {
|
||||
$this->assertEqual(0, $grade_item->hidden);
|
||||
$this->assertEqual(0, $grade->hidden);
|
||||
|
||||
$grade_item->set_hidden(666);
|
||||
$grade_item->set_hidden(666, true);
|
||||
$grade = new grade_grade($grade_item->get_final(1));
|
||||
|
||||
$this->assertEqual(666, $grade_item->hidden);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.org //
|
||||
// //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
@@ -91,7 +91,7 @@ class grade_outcome_test extends grade_test {
|
||||
$grade_outcome = grade_outcome::fetch(array('id'=>$this->grade_outcomes[0]->id));
|
||||
$this->assertEqual($this->grade_outcomes[0]->id, $grade_outcome->id);
|
||||
$this->assertEqual($this->grade_outcomes[0]->shortname, $grade_outcome->shortname);
|
||||
|
||||
$grade_outcome->load_scale();
|
||||
$this->assertEqual($this->scale[2]->id, $grade_outcome->scale->id);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class grade_test extends UnitTestCase {
|
||||
/// Define table course_modules to be created
|
||||
$table = new XMLDBTable('course_modules');
|
||||
|
||||
if (!table_exists($table)) {
|
||||
if ($result && !table_exists($table)) {
|
||||
/// Adding fields to table course_modules
|
||||
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
|
||||
$table->addFieldInfo('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
|
||||
@@ -151,7 +151,7 @@ class grade_test extends UnitTestCase {
|
||||
/// Define table modules to be created
|
||||
$table = new XMLDBTable('modules');
|
||||
|
||||
if (!table_exists($table)) {
|
||||
if ($result && !table_exists($table)) {
|
||||
|
||||
/// Adding fields to table modules
|
||||
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
|
||||
@@ -177,7 +177,7 @@ class grade_test extends UnitTestCase {
|
||||
/// Define table grade_items to be created
|
||||
$table = new XMLDBTable('grade_items');
|
||||
|
||||
if (!table_exists($table)) {
|
||||
if ($result && !table_exists($table)) {
|
||||
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
|
||||
$table->addFieldInfo('courseid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null);
|
||||
$table->addFieldInfo('categoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null);
|
||||
|
||||
Reference in New Issue
Block a user