mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +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
|
@ -45,11 +45,11 @@ class qtype_calculated_test extends advanced_testcase {
|
|||
protected $tolerance = 0.00000001;
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_calculated();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ class qtype_calculatedsimple_test extends advanced_testcase {
|
|||
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_calculatedsimple();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ class qtype_ddimageortext_test extends basic_testcase {
|
|||
/** @var qtype_ddimageortext instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = question_bank::get_qtype('ddimageortext');;
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ class qtype_ddmarker_test extends advanced_testcase {
|
|||
/** @var qtype_ddmarker instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = question_bank::get_qtype('ddmarker');;
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ class qtype_ddwtos_test extends question_testcase {
|
|||
/** @var qtype_ddwtos instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = question_bank::get_qtype('ddwtos');;
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ require_once($CFG->dirroot . '/question/type/description/edit_description_form.p
|
|||
class qtype_description_test extends advanced_testcase {
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_description();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ require_once($CFG->dirroot . '/question/type/essay/questiontype.php');
|
|||
class qtype_essay_test extends advanced_testcase {
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_essay();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ class qtype_gapselect_test extends question_testcase {
|
|||
/** @var qtype_gapselect instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = question_bank::get_qtype('gapselect');
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ class qtype_match_test extends advanced_testcase {
|
|||
/** @var qtype_match instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_match();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,11 +43,11 @@ class qtype_multianswer_test extends advanced_testcase {
|
|||
/** @var qtype_multianswer instance of the question type class to test. */
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_multianswer();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ require_once($CFG->dirroot . '/question/type/multichoice/edit_multichoice_form.p
|
|||
class qtype_multichoice_test extends advanced_testcase {
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_multichoice();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ class qtype_numerical_test extends advanced_testcase {
|
|||
protected $tolerance = 0.00000001;
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_numerical();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ require_once($CFG->dirroot . '/question/type/random/questiontype.php');
|
|||
class qtype_random_test extends advanced_testcase {
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_random();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@ class qtype_shortanswer_test extends advanced_testcase {
|
|||
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_shortanswer();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,10 +58,10 @@ class test_response_answer_comparer implements question_response_answer_comparer
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class question_first_matching_answer_grading_strategy_testcase extends advanced_testcase {
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
}
|
||||
|
||||
public function test_no_answers_gives_null() {
|
||||
|
|
|
@ -41,11 +41,11 @@ require_once($CFG->dirroot . '/question/type/truefalse/edit_truefalse_form.php')
|
|||
class qtype_truefalse_test extends advanced_testcase {
|
||||
protected $qtype;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void {
|
||||
$this->qtype = new qtype_truefalse();
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
protected function tearDown(): void {
|
||||
$this->qtype = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue