mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-47675 phpunit: Update unit tests to pass on MSSQL
Unit tests were failing on MSSQL. gc_collect_cycles() was removed from the phpunit utils.php file to save time in running the tests, but MSSQL doesn't clean up open files as well as other databases. This patch includes the garbage collection for the unit tests that require it.
This commit is contained in:
parent
b49de5d930
commit
c42d18183a
@ -35,6 +35,13 @@ global $CFG;
|
||||
*/
|
||||
class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
public function test_proceed_without_prepare() {
|
||||
$this->resetAfterTest(true);
|
||||
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
|
||||
|
@ -36,6 +36,13 @@ require_once($CFG->libdir . '/csvlib.class.php');
|
||||
*/
|
||||
class tool_uploadcourse_processor_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
public function test_basic() {
|
||||
global $DB;
|
||||
$this->resetAfterTest(true);
|
||||
|
@ -38,6 +38,13 @@ require_once($CFG->libdir . '/completionlib.php');
|
||||
*/
|
||||
class core_backup_moodle2_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the availability field on modules and sections is correctly
|
||||
* backed up and restored.
|
||||
|
@ -33,6 +33,13 @@ require_once($CFG->dirroot . '/tag/lib.php');
|
||||
|
||||
class core_course_courselib_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set forum specific test values for calling create_module().
|
||||
*
|
||||
|
@ -47,6 +47,13 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
||||
require_once($CFG->dirroot . '/course/externallib.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create_categories
|
||||
*/
|
||||
|
@ -51,6 +51,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
$this->resetAfterTest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
public function test_question_reorder_qtypes() {
|
||||
$this->assertEquals(
|
||||
array(0 => 't2', 1 => 't1', 2 => 't3'),
|
||||
|
@ -52,6 +52,13 @@ class assignfeedback_editpdf_testcase extends mod_assign_base_testcase {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy up open files that may be left open.
|
||||
*/
|
||||
protected function tearDown() {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
protected function create_assign_and_submit_pdf() {
|
||||
global $CFG;
|
||||
$assign = $this->create_instance(array('assignsubmission_onlinetext_enabled' => 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user