Enhancement: Declare test code in separate directories#6
Enhancement: Declare test code in separate directories#6localheinz wants to merge 1 commit intomainfrom
Conversation
93a865f to
1ae92a8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
========================================
Coverage ? 100.00%
Complexity ? 8
========================================
Files ? 3
Lines ? 16
Branches ? 0
========================================
Hits ? 16
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. |
499f7d9 to
ba4e80b
Compare
| @@ -1,5 +1,6 @@ | |||
| /.github/ export-ignore | |||
| /.phive/ export-ignore | |||
| /test/ export-ignore | |||
There was a problem hiding this comment.
When you work on a package and declare test code in separate directories, adding exclusions for test code in .gitattributes is less work.
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Localheinz\\OrganizingTestCodeInPhp\\Test\\": "test/" | ||
| } | ||
| }, |
There was a problem hiding this comment.
When you declare test code in separate directories, managing exclusions for the composer autoloader in composer.json is unnecessary. Instead, you configure and document namespaces for test code via an autoloader configuration in the autoload-dev section.
| "source": { | ||
| "directories": [ | ||
| "src" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
When you declare test code in separate directories, managing exclusions for infection/infection in infection.json is unnecessary.
phpunit.xml
Outdated
| <include> | ||
| <directory suffix=".php">src/</directory> | ||
| </include> |
There was a problem hiding this comment.
When you declare test code in separate directories, managing exclusions for collecting code coverage with phpunit/phpunit in phpunit.xml is unnecessary.
501f8b4 to
497c2f7
Compare
69e0ff5 to
89e20b5
Compare
89e20b5 to
30c271d
Compare
This pull request
test/