diff --git a/backup/controller/tests/controller_test.php b/backup/controller/tests/controller_test.php index 41fd99f4fe8..8ea8d966a6c 100644 --- a/backup/controller/tests/controller_test.php +++ b/backup/controller/tests/controller_test.php @@ -37,7 +37,7 @@ class backup_controller_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user used if for testing - public function setUp() { + protected function setUp() { global $DB, $CFG; $this->resetAfterTest(true); diff --git a/backup/converter/moodle1/tests/lib_test.php b/backup/converter/moodle1/tests/lib_test.php index 6bc3d15af06..0a7eaa5bc06 100644 --- a/backup/converter/moodle1/tests/lib_test.php +++ b/backup/converter/moodle1/tests/lib_test.php @@ -35,7 +35,7 @@ class moodle1_converter_test extends advanced_testcase { /** @var string the name of the directory containing the unpacked Moodle 1.9 backup */ protected $tempdir; - public function setUp() { + protected function setUp() { global $CFG; $this->tempdir = convert_helper::generate_id('simpletest'); @@ -67,7 +67,7 @@ class moodle1_converter_test extends advanced_testcase { ); } - public function tearDown() { + protected function tearDown() { global $CFG; if (empty($CFG->keeptempdirectoriesonbackup)) { fulldelete("$CFG->tempdir/backup/$this->tempdir"); diff --git a/backup/util/checks/tests/checks_test.php b/backup/util/checks/tests/checks_test.php index 15d76e4d6f6..9bfd1fc01a1 100644 --- a/backup/util/checks/tests/checks_test.php +++ b/backup/util/checks/tests/checks_test.php @@ -39,7 +39,7 @@ class backup_check_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user record id - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); diff --git a/backup/util/dbops/tests/dbops_test.php b/backup/util/dbops/tests/dbops_test.php index a97aa13fa95..219912cbe4f 100644 --- a/backup/util/dbops/tests/dbops_test.php +++ b/backup/util/dbops/tests/dbops_test.php @@ -38,7 +38,7 @@ class backup_dbops_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user record used for testing - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); diff --git a/backup/util/plan/tests/plan_test.php b/backup/util/plan/tests/plan_test.php index b2a7ba3f7f4..a3eb240f815 100644 --- a/backup/util/plan/tests/plan_test.php +++ b/backup/util/plan/tests/plan_test.php @@ -36,7 +36,7 @@ class backup_plan_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user record used for testing - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); diff --git a/backup/util/plan/tests/step_test.php b/backup/util/plan/tests/step_test.php index b5c3aea6eb3..b9a2e6d830a 100644 --- a/backup/util/plan/tests/step_test.php +++ b/backup/util/plan/tests/step_test.php @@ -36,7 +36,7 @@ class backup_step_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user record used for testing - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); diff --git a/backup/util/plan/tests/task_test.php b/backup/util/plan/tests/task_test.php index 03fbb9ebb13..ef26f9b9c8a 100644 --- a/backup/util/plan/tests/task_test.php +++ b/backup/util/plan/tests/task_test.php @@ -36,7 +36,7 @@ class backup_task_test extends advanced_testcase { protected $courseid; // course id used for testing protected $userid; // user record used for testing - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); diff --git a/lib/ddl/tests/ddl_test.php b/lib/ddl/tests/ddl_test.php index 15cca4238b0..9f7385a6a4a 100644 --- a/lib/ddl/tests/ddl_test.php +++ b/lib/ddl/tests/ddl_test.php @@ -30,7 +30,7 @@ class ddl_testcase extends database_driver_testcase { private $tables = array(); private $records= array(); - public function setUp() { + protected function setUp() { //global $CFG; //require_once($CFG->libdir . '/adminlib.php'); diff --git a/lib/phpunit/lib.php b/lib/phpunit/lib.php index 457391ed22d..07b239687ef 100644 --- a/lib/phpunit/lib.php +++ b/lib/phpunit/lib.php @@ -954,7 +954,7 @@ class database_driver_testcase extends PHPUnit_Framework_TestCase { self::$extradb = $d; } - public function setUp() { + protected function setUp() { global $DB; if (self::$extradb) { @@ -964,7 +964,7 @@ class database_driver_testcase extends PHPUnit_Framework_TestCase { } } - public function tearDown() { + protected function tearDown() { // delete all test tables $dbman = $this->tdb->get_manager(); $tables = $this->tdb->get_tables(false); diff --git a/lib/tests/blocklib_test.php b/lib/tests/blocklib_test.php index a7d3baab374..704d3871fad 100644 --- a/lib/tests/blocklib_test.php +++ b/lib/tests/blocklib_test.php @@ -53,14 +53,14 @@ class moodle_block_manager_testcase extends basic_testcase { protected $testpage; protected $blockmanager; - public function setUp() { + protected function setUp() { parent::setUp(); $this->testpage = new moodle_page(); $this->testpage->set_context(get_context_instance(CONTEXT_SYSTEM)); $this->blockmanager = new testable_block_manager($this->testpage); } - public function tearDown() { + protected function tearDown() { $this->testpage = null; $this->blockmanager = null; parent::tearDown(); diff --git a/lib/tests/cssslib_test.php b/lib/tests/cssslib_test.php index bff1c94dea9..1fd9d1f4213 100644 --- a/lib/tests/cssslib_test.php +++ b/lib/tests/cssslib_test.php @@ -42,7 +42,7 @@ class css_optimiser_test extends advanced_testcase { /** * Sets up the test class */ - public function setUp() { + protected function setUp() { global $CFG; parent::setUp(); // We need to disable these if they are enabled to that we can predict diff --git a/lib/tests/eventslib_test.php b/lib/tests/eventslib_test.php index 77458a3532f..fd153961a22 100644 --- a/lib/tests/eventslib_test.php +++ b/lib/tests/eventslib_test.php @@ -103,7 +103,7 @@ class eventslib_test extends advanced_testcase { * data have to be artificially inseminated (:-) in the DB. * @return void */ - public function setUp() { + protected function setUp() { parent::setUp(); // Set global category settings to -1 (not force) sample_function_handler('reset'); @@ -117,7 +117,7 @@ class eventslib_test extends advanced_testcase { * Delete temporary entries from the database * @return void */ - public function tearDown() { + protected function tearDown() { events_uninstall('unittest'); parent::tearDown(); } diff --git a/lib/tests/filter_test.php b/lib/tests/filter_test.php index 30f1ee2688b..20dc44bf5e5 100644 --- a/lib/tests/filter_test.php +++ b/lib/tests/filter_test.php @@ -34,7 +34,7 @@ require_once($CFG->libdir . '/filterlib.php'); */ class filter_active_global_test extends advanced_testcase { - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); $DB->delete_records('filter_active', array()); @@ -236,7 +236,7 @@ class filter_active_global_test extends advanced_testcase { */ class filter_active_local_test extends advanced_testcase { - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); $DB->delete_records('filter_active', array()); @@ -317,7 +317,7 @@ class filter_active_local_test extends advanced_testcase { */ class filter_config_test extends advanced_testcase { - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); $DB->delete_records('filter_config', array()); @@ -383,7 +383,7 @@ class filter_get_active_available_in_context_test extends advanced_testcase { self::$syscontext = context_system::instance(); } - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); @@ -562,7 +562,7 @@ class filter_preload_activities_test extends advanced_testcase { self::$activity2context = context_module::instance($page2->cmid); } - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); @@ -653,7 +653,7 @@ class filter_preload_activities_test extends advanced_testcase { class filter_delete_config_test extends advanced_testcase { - public function setUp() { + protected function setUp() { global $DB; parent::setUp(); @@ -708,7 +708,7 @@ class filter_filter_set_applies_to_strings extends advanced_testcase { protected $origcfgstringfilters; protected $origcfgfilterall; - public function setUp() { + protected function setUp() { global $DB, $CFG; parent::setUp(); @@ -721,7 +721,7 @@ class filter_filter_set_applies_to_strings extends advanced_testcase { $this->origcfgfilterall = $CFG->filterall; } - public function tearDown() { + protected function tearDown() { global $CFG; $CFG->stringfilters = $this->origcfgstringfilters; $CFG->filterall = $this->origcfgfilterall; diff --git a/lib/tests/textlib_test.php b/lib/tests/textlib_test.php index a85d9ff7801..fcdb1fdd3cb 100644 --- a/lib/tests/textlib_test.php +++ b/lib/tests/textlib_test.php @@ -385,7 +385,7 @@ class collatorlib_testcase extends basic_testcase { * Prepares things for this test case * @return void */ - public function setUp() { + protected function setUp() { global $SESSION; if (isset($SESSION->lang)) { $this->initiallang = $SESSION->lang; @@ -403,7 +403,7 @@ class collatorlib_testcase extends basic_testcase { * Cleans things up after this test case has run * @return void */ - public function tearDown() { + protected function tearDown() { global $SESSION; parent::tearDown(); if ($this->initiallang !== null) { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a7bed3fa176..a47829b1b52 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -38,6 +38,9 @@ backup/converter/moodle1/tests backup/util + + blog/tests +