Skip to content

Commit 1e60c9b

Browse files
committed
phpunit tests: replace @coverage annotation by attribute 2
1 parent cb710c7 commit 1e60c9b

File tree

9 files changed

+18
-0
lines changed

9 files changed

+18
-0
lines changed

step/adminapprove/tests/admin_approve_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ final class admin_approve_test extends \advanced_testcase {
4343
* @throws \dml_transaction_exception
4444
* @throws \moodle_exception
4545
*/
46+
#[CoversNothing]
4647
public function test_admin_mail(): void {
4748
$this->resetAfterTest(true);
4849
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');

step/email/tests/lib_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ final class lib_test extends \advanced_testcase {
4444
* Tests \tool_lifecycle\step\email::replace_placeholders.
4545
*
4646
*/
47+
#[CoversNothing]
4748
public function test_replace_placeholders(): void {
4849
$this->resetAfterTest();
4950

step/makeinvisible/tests/make_invisible_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function setUp(): void {
5959
* @throws \dml_transaction_exception
6060
* @throws \moodle_exception
6161
*/
62+
#[CoversNothing]
6263
public function test_make_invisible(): void {
6364
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
6465
$workflow = $generator->create_workflow([], []);

trigger/byrole/tests/lifecycletrigger_byrole_test.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ protected function setUp(): void {
6464
* @throws \coding_exception
6565
* @throws \dml_exception
6666
*/
67+
#[CoversNothing]
6768
public function test_lib_validcourse(): void {
6869
global $DB;
6970
$generator = $this->getDataGenerator()->get_plugin_generator('lifecycletrigger_byrole');
@@ -84,6 +85,7 @@ public function test_lib_validcourse(): void {
8485
* @throws \coding_exception
8586
* @throws \dml_exception
8687
*/
88+
#[CoversNothing]
8789
public function test_lib_norolecourse(): void {
8890
global $DB;
8991
$generator = $this->getDataGenerator()->get_plugin_generator('lifecycletrigger_byrole');
@@ -105,6 +107,7 @@ public function test_lib_norolecourse(): void {
105107
* @throws \coding_exception
106108
* @throws \dml_exception
107109
*/
110+
#[CoversNothing]
108111
public function test_lib_norolefoundcourse(): void {
109112
global $DB;
110113
$generator = $this->getDataGenerator()->get_plugin_generator('lifecycletrigger_byrole');
@@ -130,6 +133,7 @@ public function test_lib_norolefoundcourse(): void {
130133
* @throws \coding_exception
131134
* @throws \dml_exception
132135
*/
136+
#[CoversNothing]
133137
public function test_lib_rolefoundagain(): void {
134138
global $DB;
135139
$generator = $this->getDataGenerator()->get_plugin_generator('lifecycletrigger_byrole');

trigger/categories/tests/trigger_test.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function setUp(): void {
8686
/**
8787
* Tests if courses, which are in the category are correctly triggered.
8888
*/
89+
#[CoversNothing]
8990
public function test_course_has_cat(): void {
9091

9192
$course = $this->getDataGenerator()->create_course(['category' => $this->category->id]);
@@ -110,6 +111,7 @@ public function test_course_has_cat(): void {
110111
/**
111112
* Tests if courses, which are in the category are correctly triggered.
112113
*/
114+
#[CoversNothing]
113115
public function test_course_within_cat(): void {
114116

115117
$course = $this->getDataGenerator()->create_course(['category' => $this->childcategory->id]);
@@ -134,6 +136,7 @@ public function test_course_within_cat(): void {
134136
/**
135137
* Tests if courses, which are not in the category are correctly triggered.
136138
*/
139+
#[CoversNothing]
137140
public function test_course_not_within_cat(): void {
138141
$course = $this->getDataGenerator()->create_course();
139142

trigger/customfielddelay/tests/trigger_test.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function setUp(): void {
8383
* @throws \coding_exception
8484
* @throws \dml_exception
8585
*/
86+
#[CoversNothing]
8687
public function test_young_course(): void {
8788
$customfieldvalue = ['shortname' => 'test', 'value' => time() + 1000000];
8889
$course = $this->getDataGenerator()->create_course(['customfields' => [$customfieldvalue]]);
@@ -107,6 +108,7 @@ public function test_young_course(): void {
107108
* @throws \coding_exception
108109
* @throws \dml_exception
109110
*/
111+
#[CoversNothing]
110112
public function test_young_course_with_second_customcourse_field(): void {
111113

112114
// Add additional course field.
@@ -137,6 +139,7 @@ public function test_young_course_with_second_customcourse_field(): void {
137139
* @throws \coding_exception
138140
* @throws \dml_exception
139141
*/
142+
#[CoversNothing]
140143
public function test_old_course(): void {
141144

142145
$customfieldvalue = ['shortname' => 'test', 'value' => time() - 1000000];

trigger/delayedcourses/tests/trigger_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public function setUp(): void {
7777
/**
7878
* Tests if trigger for inclusion of delayed courses works as expected.
7979
*/
80+
#[CoversNothing]
8081
public function test_include_delayedcourses(): void {
8182

8283
$this->triggerinstance = generator::create_workflow_with_delayedcourses_trigger();

trigger/semindependent/tests/trigger_test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function setUp(): void {
6464
/**
6565
* Tests if trigger for inclusion of semester independent courses works as expected.
6666
*/
67+
#[CoversNothing]
6768
public function test_include_semester_independent(): void {
6869

6970
$this->triggerinstance = generator::create_workflow_with_semindependent(false);
@@ -88,6 +89,7 @@ public function test_include_semester_independent(): void {
8889
/**
8990
* Tests if trigger for exclusion of semester independent courses works as expected.
9091
*/
92+
#[CoversNothing]
9193
public function test_exclude_semester_independent(): void {
9294

9395
$this->triggerinstance = generator::create_workflow_with_semindependent(true);

trigger/startdatedelay/tests/trigger_test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function setUp(): void {
6060
/**
6161
* Tests if courses, which are newer than the default of 190 days are not triggered by this plugin.
6262
*/
63+
#[CoversNothing]
6364
public function test_young_course(): void {
6465

6566
$course = $this->getDataGenerator()->create_course(['startdate' => time() - 50 * 24 * 60 * 60]);
@@ -78,6 +79,7 @@ public function test_young_course(): void {
7879
/**
7980
* Tests if courses, which are older than the default of 190 days are triggered by this plugin.
8081
*/
82+
#[CoversNothing]
8183
public function test_old_course(): void {
8284

8385
$course = $this->getDataGenerator()->create_course(['startdate' => time() - 200 * 24 * 60 * 60]);

0 commit comments

Comments
 (0)