Skip to content

Commit dec7de3

Browse files
authored
Merge pull request #999 from PHPCSStandards/phpcs-4.0/feature/300-abstractsniffunittest-flag-missing-fixes-files
AbstractSniffTestCase: flag missing `.fixed` files
2 parents bfd521d + 97fd6a5 commit dec7de3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/Standards/AbstractSniffTestCase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ final public function testSniff()
230230
$failureMessages[] = "Fixed version of $filename does not match expected version in $fixedFilename; the diff is\n$diff";
231231
}
232232
}
233-
} else if (is_callable([$this, 'addWarning']) === true) {
234-
$this->addWarning("Missing fixed version of $filename to verify the accuracy of fixes, while the sniff is making fixes against the test case file");
233+
} else {
234+
$diff = trim($phpcsFile->fixer->generateDiff($testFile));
235+
$failureMessages[] = "Missing fixed version of $filename to verify the accuracy of fixes, while the sniff is making fixes against the test case file; the diff is\n$diff";
235236
}
236237
}//end if
237238

0 commit comments

Comments
 (0)