mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
MDL-32149 setUp() and tearDown() are supposed to be 'protected', add missing blog testcase
This commit is contained in:
parent
814a96edfb
commit
1cbf2a20ca
15 changed files with 29 additions and 26 deletions
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
<directory suffix="_test.php">backup/converter/moodle1/tests</directory>
|
||||
<directory suffix="_test.php">backup/util</directory>
|
||||
</testsuite>
|
||||
<testsuite name="core_blog">
|
||||
<directory suffix="_test.php">blog/tests</directory>
|
||||
</testsuite>
|
||||
|
||||
<!--Plugin suites: use admin/tool/phpunit/cli/util.php to build phpunit.xml from phpunit.xml.dist with up-to-date list of plugins in current install-->
|
||||
<!--@plugin_suites_start@-->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue