Move production files under src/ directory - #44
Merged
Conversation
Reorganize the library's production code (autoloaded classes, traits,
bootstrap helpers, and the built-in Unit/Integration/Fixtures) under a
dedicated `src/` directory to clearly separate shipped code from the
package's own test suite, tooling, and configuration.
Updated configuration and path references to follow the move:
- composer.json: PSR-4 `WPMedia\PHPUnit\` now maps to `src/`; added an
autoload-dev PSR-4 mapping for the `WPMedia\PHPUnit\Tests\` namespace.
- wpmedia-phpunit: require `src/BootstrapManager.php`.
- BootstrapManager: adjust __DIR__-based resolution of the consumer's
vendor/bin/phpunit and root directory for the extra directory level.
- src/{Unit,Integration}/phpunit.xml.dist: bump the relative Tests paths
by one level.
- Tests/{Unit,Integration}/init-tests.php: require the bootstrap from
`src/`.
- phpstan.neon.dist / phpstan-baseline.neon / phpcs.xml.dist: point the
analyzed paths at `src/`.
Verified: unit suite (95 tests, 297 assertions), PHPCS and PHPStan all pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
remyperona
force-pushed
the
reorganize-src-directory
branch
from
August 14, 2026 16:12
b764798 to
1c150e6
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reorganize the library's production code under a dedicated
src/directory to clearly separate shipped code from the package's own test suite (Tests/), tooling (bin/,wpmedia-phpunit), and configuration.Tests/,bin/,wpmedia-phpunit, and root config/dotfiles are unchanged in location.Config updated to follow the move
WPMedia\PHPUnit\now maps tosrc/; added anautoload-devmappingWPMedia\PHPUnit\Tests\ → Tests/so the self-tests still autoload.src/BootstrapManager.php.__DIR__-relative lookups (consumer'svendor/bin/phpunitand root dir) each gained onedirname()for the extra directory level.Tests/paths bumped by one level.src/.Public namespaces are unchanged, so consumers extending
WPMedia\PHPUnit\Integration\TestCase/WPMedia\PHPUnit\Unit\TestCaseare unaffected. CI workflows and README needed no changes.Testing
composer test-unit→ OK (91 tests, 282 assertions), matching the pre-change baseline.php -lclean on all touched files; autoloader regenerates to the new paths.🤖 Generated with Claude Code