Skip to content

Commit

Permalink
OutputTest: fix risky test
Browse files Browse the repository at this point in the history
The `OutputTest::testGitLabOutput()` was being marked as risky for the first test case (no errors) as no assertions were being run.

This commit adds an extra assertion to prevent this, but also to make the test more thorough as the test will now also fail if the number of errors expected versus received does not match.
  • Loading branch information
jrfnl committed Mar 27, 2024
1 parent c09ad7f commit c6dad33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Output.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class OutputTest extends Tester\TestCase

$result = (array) json_decode($writer->getLogs());

Assert::equal(count($errors), count($result));

for ($i = 0; $i < count($result) && $i < count($errors); $i++) {
$message = $errors[$i]->getMessage();
$filePath = $errors[$i]->getFilePath();
Expand Down

0 comments on commit c6dad33

Please sign in to comment.