-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Declare test code in separate directory #5
base: main
Are you sure you want to change the base?
Conversation
a521960
to
917a413
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
========================================
Coverage ? 100.00%
Complexity ? 8
========================================
Files ? 3
Lines ? 16
Branches ? 0
========================================
Hits ? 16
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. |
a9eab03
to
4f5af4c
Compare
@@ -1,5 +1,6 @@ | |||
/.github/ export-ignore | |||
/.phive/ export-ignore | |||
/test/ export-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you work on a package and declare test code in a separate directory, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you declare test code in a separate directory, 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.
"directories": [ | ||
"src" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you declare test code in a separate directory, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you declare test code in a separate directory, managing exclusions for collecting code coverage with phpunit/phpunit
in phpunit.xml
is unnecessary.
ef027e9
to
e657c81
Compare
e4cc495
to
648de2f
Compare
648de2f
to
d4ae561
Compare
This pull request
test/