-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files/TestDoubles: implement use of new PathHelper and PathValidation…
…Helper classes and check case-sensitively Aside from starting to use the new `PathHelper` and `PathValidationHelper` utility function classes, this commit also changes the path comparison from case-INsensitive to case-sensitive, which, what with the change to strict PSR-4 compliance for all test files, including double/mock files, is a change which needs to be made anyway. The tests sub-directory names have been updated to proper case to be in line with this change, the inline property settings in test case files have been updated too. On top of that, a couple of dedicated new test cases have been added to verify the case-sensitive handling of the `double_path` property. Includes updating two pre-existing tests to pass duplicate excluded files in different ways.
- Loading branch information
Showing
22 changed files
with
75 additions
and
56 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/Mocks/correct-custom-dir-not-mock.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Mocks/,/tests/Assets,tests/Mocks,./tests/Mocks | ||
<?php | ||
|
||
class Prefix_ClassName {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 6 additions & 0 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/Mocks/correct-custom-dir.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Mocks,/tests/Assets,tests/Mocks/,./tests/Mocks | ||
<?php | ||
|
||
class Prefix_ClassName_Double {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 6 additions & 0 deletions
6
...sts/Files/TestDoublesUnitTests/tests/lowercase/correct-custom-dir-not-mock-wrong-case.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Lowercase | ||
<?php | ||
|
||
class Prefix_ClassName {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 6 additions & 0 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/lowercase/correct-custom-dir-wrong-case.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Lowercase | ||
<?php | ||
|
||
class Prefix_ClassName_Double {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 6 additions & 0 deletions
6
...ests/Files/TestDoublesUnitTests/tests/lowercase/correct-custom-lowercase-dir-not-mock.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/lowercase/ | ||
<?php | ||
|
||
class Prefix_ClassName {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 6 additions & 0 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/lowercase/correct-custom-lowercase-dir.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,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/lowercase | ||
<?php | ||
|
||
class Prefix_ClassName_Double {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
6 changes: 0 additions & 6 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/mocks/correct-custom-dir-not-mock.inc
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
Yoast/Tests/Files/TestDoublesUnitTests/tests/mocks/correct-custom-dir.inc
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
Yoast/Tests/Files/TestDoublesUnitTests/tests/non-existant-doubles-dir.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/doesnotexist | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doesnotexist | ||
<?php | ||
|
||
class Prefix_ClassName_Double {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/doubles | ||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
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
4 changes: 2 additions & 2 deletions
4
Yoast/Tests/Files/TestDoublesUnitTests/tests/not-in-correct-custom-dir.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/mocks,/tests/assets | ||
phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Mocks,/tests/Assets | ||
<?php | ||
|
||
class Prefix_ClassName_Double {} | ||
|
||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/doubles | ||
// phpcs:set Yoast.Files.TestDoubles doubles_path[] /tests/Doubles |
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