MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods now are required to return void. This was warned with phpunit 7 and now is enforced. At the same time, fix a few wrong function names, provider data and param types, return statements...
This commit is contained in:
@@ -67,7 +67,7 @@ abstract class database_driver_testcase extends base_testcase {
|
||||
$this->setRunTestInSeparateProcess(false);
|
||||
}
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
public static function setUpBeforeClass(): void {
|
||||
global $CFG;
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
@@ -101,7 +101,7 @@ abstract class database_driver_testcase extends base_testcase {
|
||||
self::$extradb = $d;
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
global $DB;
|
||||
parent::setUp();
|
||||
|
||||
@@ -112,7 +112,7 @@ abstract class database_driver_testcase extends base_testcase {
|
||||
}
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
// delete all test tables
|
||||
$dbman = $this->tdb->get_manager();
|
||||
$tables = $this->tdb->get_tables(false);
|
||||
@@ -125,7 +125,7 @@ abstract class database_driver_testcase extends base_testcase {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass() {
|
||||
public static function tearDownAfterClass(): void {
|
||||
if (self::$extradb) {
|
||||
self::$extradb->dispose();
|
||||
self::$extradb = null;
|
||||
|
||||
Reference in New Issue
Block a user