mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-16483 $CFG->unittestprefix not required anymore to run unit tests that do not need fake db; it should be saer to let admins modify the prefix in config.php instead of modifying it from php
This commit is contained in:
parent
efd8c7fc6b
commit
84ebf08dcc
5 changed files with 163 additions and 153 deletions
|
@ -8,6 +8,7 @@ Changes:
|
|||
* Bug fix in simpletest.php and test_case.php. Marked with //moodlefix begins,
|
||||
//moodlefix ends comments. This has been reported back to the simpletest mailing
|
||||
list. Hopefully will be included in a future release.
|
||||
* modified run() in test_case.php - skipping tests that need fake db if prefix not set
|
||||
|
||||
skodak, Tim
|
||||
|
||||
|
|
|
@ -596,6 +596,16 @@ class TestSuite {
|
|||
if (is_string($this->_test_cases[$i])) {
|
||||
$class = $this->_test_cases[$i];
|
||||
$test = &new $class();
|
||||
// moodle hack start
|
||||
global $CFG;
|
||||
if (empty($CFG->unittestprefix)) {
|
||||
if ($test instanceof FakeDBUnitTestCase) {
|
||||
// do not execute this test because test tables not present!
|
||||
unset($test);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// moodle hack end
|
||||
$test->run($reporter);
|
||||
unset($test);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue