Skip to content

Enhancement: Declare test code in separate directory#5

Open
localheinz wants to merge 1 commit into
mainfrom
feature/separate-directory
Open

Enhancement: Declare test code in separate directory#5
localheinz wants to merge 1 commit into
mainfrom
feature/separate-directory

Conversation

@localheinz
Copy link
Copy Markdown
Owner

This pull request

  • declares test code in test/

@localheinz localheinz self-assigned this Mar 3, 2023
@localheinz localheinz requested a review from ergebnis-bot as a code owner March 3, 2023 08:38
@localheinz localheinz force-pushed the feature/separate-directory branch 2 times, most recently from a521960 to 917a413 Compare March 3, 2023 09:20
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d732079). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@localheinz localheinz force-pushed the feature/separate-directory branch 3 times, most recently from a9eab03 to 4f5af4c Compare March 3, 2023 09:50
Comment thread .gitattributes
@@ -1,5 +1,6 @@
/.github/ export-ignore
/.phive/ export-ignore
/test/ export-ignore
Copy link
Copy Markdown
Owner Author

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.

Comment thread composer.json
Comment on lines +39 to +43
"autoload-dev": {
"psr-4": {
"Localheinz\\OrganizingTestCodeInPhp\\Test\\": "test/"
}
},
Copy link
Copy Markdown
Owner Author

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.

Comment thread infection.json
Comment on lines +12 to +14
"directories": [
"src"
]
Copy link
Copy Markdown
Owner Author

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.

Comment thread phpunit.xml Outdated
Comment on lines +28 to +30
<include>
<directory suffix=".php">src/</directory>
</include>
Copy link
Copy Markdown
Owner Author

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.

@localheinz localheinz force-pushed the feature/separate-directory branch 2 times, most recently from ef027e9 to e657c81 Compare September 20, 2023 11:23
@localheinz localheinz force-pushed the feature/separate-directory branch 2 times, most recently from e4cc495 to 648de2f Compare January 2, 2024 11:25
@localheinz localheinz force-pushed the feature/separate-directory branch from 648de2f to d4ae561 Compare January 2, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants