Skip to content

Commit

Permalink
Be stricter and don't allow warnings on phpcs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 authored and mchurchward committed May 30, 2024
1 parent fbe223f commit 10f5082
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
moodle-plugin-ci phplint
moodle-plugin-ci phpcpd
moodle-plugin-ci phpmd
moodle-plugin-ci phpcs
moodle-plugin-ci phpcs --max-warnings 0
moodle-plugin-ci phpcbf
moodle-plugin-ci validate
moodle-plugin-ci savepoints
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
php build/moodle-plugin-ci.phar phplint
php build/moodle-plugin-ci.phar phpcpd
php build/moodle-plugin-ci.phar phpmd
php build/moodle-plugin-ci.phar phpcs
php build/moodle-plugin-ci.phar phpcs --max-warnings 0
php build/moodle-plugin-ci.phar phpcbf
php build/moodle-plugin-ci.phar validate
php build/moodle-plugin-ci.phar savepoints
Expand Down
10 changes: 5 additions & 5 deletions tests/Fixture/moodle-local_ci/tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
* @copyright Copyright (c) 2015 Blackboard Inc. (http://www.blackboard.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class lib_test extends \basic_testcase {
final class lib_test extends \basic_testcase {
/**
* Test addition.
*
* @covers ::local_ci_add
*/
public function test_local_ci_add() {
public function test_local_ci_add(): void {
$this->assertEquals(4, local_ci_add(2, 2));
$this->assertEquals(2, local_ci_add(4, -2));
$this->assertEquals(0, local_ci_add(-4, 4));
Expand All @@ -54,7 +54,7 @@ public function test_local_ci_add() {
*
* @covers ::local_ci_subtract
*/
public function test_local_ci_subtract() {
public function test_local_ci_subtract(): void {
$this->assertEquals(0, local_ci_subtract(2, 2));
$this->assertEquals(6, local_ci_subtract(4, -2));
$this->assertEquals(-8, local_ci_subtract(-4, 4));
Expand All @@ -65,7 +65,7 @@ public function test_local_ci_subtract() {
*
* @covers \local_ci\math::add
*/
public function test_local_ci_math() {
public function test_local_ci_math(): void {
$math = new \local_ci_math();
$this->assertEquals(4, $math->add(2, 2));
$this->assertEquals(2, $math->add(4, -2));
Expand All @@ -77,7 +77,7 @@ public function test_local_ci_math() {
*
* @covers \local_ci\math::add
*/
public function test_local_ci_math_class() {
public function test_local_ci_math_class(): void {
$math = new math();
$this->assertEquals(4, $math->add(2, 2));
$this->assertEquals(2, $math->add(4, -2));
Expand Down

0 comments on commit 10f5082

Please sign in to comment.