Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be stricter and don't allow warnings on phpcs tests #296

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading