Make travis happy (#282)

This commit is contained in:
Mark Nelson 2019-05-23 10:48:10 +08:00
parent bb2ed945fa
commit 01e427cf57

View file

@ -37,11 +37,6 @@ global $CFG;
*/ */
class mod_customcert_element_helper_testcase extends advanced_testcase { class mod_customcert_element_helper_testcase extends advanced_testcase {
/**
* Static variable used for clearing cache
*/
static $courseId;
/** /**
* Test set up. * Test set up.
*/ */
@ -202,9 +197,6 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
// Create a course. // Create a course.
$course = $this->getDataGenerator()->create_course(); $course = $this->getDataGenerator()->create_course();
// Assign course->id for cache
self::$courseId = $course->id;
// Set that we want 3 decimals to display. // Set that we want 3 decimals to display.
grade_set_setting($course->id, 'decimalpoints', 3); grade_set_setting($course->id, 'decimalpoints', 3);
@ -263,6 +255,8 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
$this->assertEquals(null, $grade->get_grade()); $this->assertEquals(null, $grade->get_grade());
$this->assertEquals('-', $grade->get_displaygrade()); $this->assertEquals('-', $grade->get_displaygrade());
$this->assertEquals(null, $grade->get_dategraded()); $this->assertEquals(null, $grade->get_dategraded());
grade_get_setting($course->id, null, null, true);
} }
/** /**
@ -272,9 +266,6 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
// Create a course. // Create a course.
$course = $this->getDataGenerator()->create_course(); $course = $this->getDataGenerator()->create_course();
// Assign course->id for cache
self::$courseId = $course->id;
// Set that we want 3 decimals to display. // Set that we want 3 decimals to display.
grade_set_setting($course->id, 'decimalpoints', 3); grade_set_setting($course->id, 'decimalpoints', 3);
@ -324,6 +315,8 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
$this->assertEquals(null, $grade->get_grade()); $this->assertEquals(null, $grade->get_grade());
$this->assertEquals('-', $grade->get_displaygrade()); $this->assertEquals('-', $grade->get_displaygrade());
$this->assertEquals(null, $grade->get_dategraded()); $this->assertEquals(null, $grade->get_dategraded());
grade_get_setting($course->id, null, null, true);
} }
/** /**
@ -333,9 +326,6 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
// Create a course. // Create a course.
$course = $this->getDataGenerator()->create_course(); $course = $this->getDataGenerator()->create_course();
// Assign course->id for cache
self::$courseId = $course->id;
// Set that we want 3 decimals to display. // Set that we want 3 decimals to display.
grade_set_setting($course->id, 'decimalpoints', 3); grade_set_setting($course->id, 'decimalpoints', 3);
@ -387,17 +377,7 @@ class mod_customcert_element_helper_testcase extends advanced_testcase {
$this->assertEquals(null, $grade->get_grade()); $this->assertEquals(null, $grade->get_grade());
$this->assertEquals('-', $grade->get_displaygrade()); $this->assertEquals('-', $grade->get_displaygrade());
$this->assertEquals(null, $grade->get_dategraded()); $this->assertEquals(null, $grade->get_dategraded());
}
/** grade_get_setting($course->id, null, null, true);
* Cleanup after all tests are executed.
*
*
* @static
* @return void
*/
public static function tearDownAfterClass() {
// Clear the cache
grade_get_setting(self::$courseId, null, null, true);
} }
} }