mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
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:
parent
c611109ed7
commit
d81a94807b
421 changed files with 531 additions and 531 deletions
|
@ -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;
|
||||
|
|
|
@ -51,7 +51,7 @@ abstract class restore_date_testcase extends advanced_testcase {
|
|||
/**
|
||||
* Setup.
|
||||
*/
|
||||
public function setUp() {
|
||||
public function setUp(): void {
|
||||
global $CFG;
|
||||
|
||||
parent::setUp();
|
||||
|
@ -160,4 +160,4 @@ abstract class restore_date_testcase extends advanced_testcase {
|
|||
return ($this->restorestartdate - $this->startdate);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
class core_phpunit_basic_testcase extends basic_testcase {
|
||||
protected $testassertexecuted = false;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
if ($this->getName() === 'test_setup_assert') {
|
||||
$this->assertTrue(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue