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 authored and grogy committed Mar 27, 2024
1 parent db896de commit ea852b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Unit/Outputs/OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function testGitLabOutput($errors)

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

$this->assertSame(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 ea852b5

Please sign in to comment.