-
-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IsUnitTestTrait: make sure namespace and class names are checked case…
…-insensitively As PHP treats namespace names and class names case-insensitively, this helper should do so too. This is a bug fix as the sniff would previously throw false positives for test classes where the case of the class name/extended class name did not match. Tested by adding an extra test to the `WordPress.Files.FilesName` sniff.
- Loading branch information
Showing
3 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
WordPress/Tests/Files/FileNameUnitTests/TestFiles/test-sample-phpunit6-case-insensitive.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
// Take note of the `PHPunit` vs `PHPUnit` in the namespace and the `Testcase` vs `TestCase` for the extended class name. | ||
class TestSample extends PHPunit\Framework\Testcase {} |