Skip to content

Commit

Permalink
MDL-73716 phpunit: remove old simpletest static members
Browse files Browse the repository at this point in the history
And replace them by phpunit @Covers annotations including
all the classes declared or extended in the removed members.

It's not awesome coverage, but better than nothing.
  • Loading branch information
stronk7 committed Feb 7, 2022
1 parent 62fe751 commit 27ec971
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 28 deletions.
2 changes: 0 additions & 2 deletions lib/tests/moodlelib_test.php
Expand Up @@ -28,8 +28,6 @@

class core_moodlelib_testcase extends advanced_testcase {

public static $includecoverage = array('lib/moodlelib.php');

/**
* Define a local decimal separator.
*
Expand Down
5 changes: 3 additions & 2 deletions mod/quiz/accessrule/securewindow/tests/rule_test.php
Expand Up @@ -35,10 +35,11 @@
*
* @copyright 2008 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \quiz_access_rule_base
* @covers \quizaccess_securewindow
*/
class quizaccess_securewindow_testcase extends basic_testcase {
public static $includecoverage = array('mod/quiz/accessrule/securewindow/rule.php');

// Nothing very testable in this class, just test that it obeys the general access rule contact.
public function test_securewindow_access_rule() {
$quiz = new stdClass();
Expand Down
8 changes: 3 additions & 5 deletions question/type/calculated/tests/questiontype_test.php
Expand Up @@ -35,13 +35,11 @@
*
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \question_type
* @covers \qtype_calculated
*/
class qtype_calculated_test extends advanced_testcase {
public static $includecoverage = array(
'question/type/questiontypebase.php',
'question/type/calculated/questiontype.php'
);

protected $tolerance = 0.00000001;
protected $qtype;

Expand Down
15 changes: 8 additions & 7 deletions question/type/calculatedsimple/tests/questiontype_test.php
Expand Up @@ -37,15 +37,16 @@
*
* @copyright 2007 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \question_type
* @covers \qtype_calculatedsimple
* @covers \question_wizard_form
* @covers \question_edit_form
* @covers \qtype_calculated_edit_form
* @covers \qtype_calculatedsimple_edit_form
*
*/
class qtype_calculatedsimple_test extends advanced_testcase {
public static $includecoverage = array(
'question/type/questiontypebase.php',
'question/type/calculatedsimple/questiontype.php',
'question/type/edit_question_form.php',
'question/type/calculatedsimple/edit_calculatedsimple_form.php'
);

protected $qtype;

protected function setUp(): void {
Expand Down
8 changes: 3 additions & 5 deletions question/type/numerical/tests/questiontype_test.php
Expand Up @@ -37,13 +37,11 @@
*
* @copyright 2006 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \question_type
* @covers \qtype_numerical
*/
class qtype_numerical_test extends advanced_testcase {
public static $includecoverage = array(
'question/type/questiontypebase.php',
'question/type/numerical/questiontype.php'
);

protected $tolerance = 0.00000001;
protected $qtype;

Expand Down
8 changes: 3 additions & 5 deletions question/type/shortanswer/tests/questiontype_test.php
Expand Up @@ -36,13 +36,11 @@
*
* @copyright 2007 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \question_type
* @covers \qtype_shortanswer
*/
class qtype_shortanswer_test extends advanced_testcase {
public static $includecoverage = array(
'question/type/questiontypebase.php',
'question/type/shortanswer/questiontype.php',
);

protected $qtype;

protected function setUp(): void {
Expand Down
4 changes: 2 additions & 2 deletions question/type/tests/questiontype_test.php
Expand Up @@ -35,10 +35,10 @@
*
* @copyright 2008 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \question_type
*/
class question_type_testcase extends advanced_testcase {
public static $includecoverage = array('question/type/questiontypebase.php');

public function test_save_question_name() {
$this->resetAfterTest();

Expand Down

0 comments on commit 27ec971

Please sign in to comment.