Skip to content

Commit 45a012f

Browse files
committed
Be stricter and don't allow warnings on phpcs tests
1 parent 1554c71 commit 45a012f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
moodle-plugin-ci phplint
134134
moodle-plugin-ci phpcpd
135135
moodle-plugin-ci phpmd
136-
moodle-plugin-ci phpcs
136+
moodle-plugin-ci phpcs --max-warnings 0
137137
moodle-plugin-ci phpcbf
138138
moodle-plugin-ci validate
139139
moodle-plugin-ci savepoints
@@ -250,7 +250,7 @@ jobs:
250250
php build/moodle-plugin-ci.phar phplint
251251
php build/moodle-plugin-ci.phar phpcpd
252252
php build/moodle-plugin-ci.phar phpmd
253-
php build/moodle-plugin-ci.phar phpcs
253+
php build/moodle-plugin-ci.phar phpcs --max-warnings 0
254254
php build/moodle-plugin-ci.phar phpcbf
255255
php build/moodle-plugin-ci.phar validate
256256
php build/moodle-plugin-ci.phar savepoints

tests/Fixture/moodle-local_ci/tests/lib_test.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
* @copyright Copyright (c) 2015 Blackboard Inc. (http://www.blackboard.com)
3838
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3939
*/
40-
class lib_test extends \basic_testcase {
40+
final class lib_test extends \basic_testcase {
4141
/**
4242
* Test addition.
4343
*
4444
* @covers ::local_ci_add
4545
*/
46-
public function test_local_ci_add() {
46+
public function test_local_ci_add(): void {
4747
$this->assertEquals(4, local_ci_add(2, 2));
4848
$this->assertEquals(2, local_ci_add(4, -2));
4949
$this->assertEquals(0, local_ci_add(-4, 4));
@@ -54,7 +54,7 @@ public function test_local_ci_add() {
5454
*
5555
* @covers ::local_ci_subtract
5656
*/
57-
public function test_local_ci_subtract() {
57+
public function test_local_ci_subtract(): void {
5858
$this->assertEquals(0, local_ci_subtract(2, 2));
5959
$this->assertEquals(6, local_ci_subtract(4, -2));
6060
$this->assertEquals(-8, local_ci_subtract(-4, 4));
@@ -65,7 +65,7 @@ public function test_local_ci_subtract() {
6565
*
6666
* @covers \local_ci\math::add
6767
*/
68-
public function test_local_ci_math() {
68+
public function test_local_ci_math(): void {
6969
$math = new \local_ci_math();
7070
$this->assertEquals(4, $math->add(2, 2));
7171
$this->assertEquals(2, $math->add(4, -2));
@@ -77,7 +77,7 @@ public function test_local_ci_math() {
7777
*
7878
* @covers \local_ci\math::add
7979
*/
80-
public function test_local_ci_math_class() {
80+
public function test_local_ci_math_class(): void {
8181
$math = new math();
8282
$this->assertEquals(4, $math->add(2, 2));
8383
$this->assertEquals(2, $math->add(4, -2));

0 commit comments

Comments
 (0)