MDL-66794 core_customfield: Reset Course handler after unit tests run.

This commit is contained in:
Mikhail Golenkov
2019-09-30 10:56:04 +10:00
parent 9528b1ff5b
commit 15136147ba
6 changed files with 48 additions and 0 deletions
+8
View File
@@ -37,6 +37,14 @@ use \core_customfield\category_controller;
*/
class core_customfield_api_testcase extends advanced_testcase {
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Tests set up.
*/
@@ -36,6 +36,14 @@ use \core_customfield\field_controller;
*/
class core_customfield_category_controller_testcase extends advanced_testcase {
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Tests set up.
*/
@@ -34,6 +34,14 @@ use core_customfield\data_controller;
*/
class core_customfield_data_controller_testcase extends advanced_testcase {
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Tests set up.
*/
@@ -38,6 +38,14 @@ use \core_customfield\field_controller;
*/
class core_customfield_field_controller_testcase extends advanced_testcase {
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Tests set up.
*/
+8
View File
@@ -35,6 +35,14 @@ defined('MOODLE_INTERNAL') || die();
*/
class core_customfield_generator_testcase extends advanced_testcase {
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Get generator
* @return core_customfield_generator
+8
View File
@@ -45,6 +45,14 @@ class core_customfield_privacy_testcase extends provider_testcase {
/** @var \core_customfield\field_controller[] */
private $cffields = [];
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass() {
$handler = core_course\customfield\course_handler::create();
$handler->delete_all();
}
/**
* Set up
*/