-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Currency][Customer][Taxonomy] Remove PHPSpec dependency and configuration from bundles where it was not used #17981
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
[Currency][Customer][Taxonomy] Remove PHPSpec dependency and configuration from bundles where it was not used #17981
Conversation
WalkthroughThis update removes PHPSpec dependencies and configuration files from several bundles, consolidates and updates test autoloading namespaces, and adjusts PHPUnit configuration to include additional test directories. It also modifies test class namespaces and import paths to align with the new test directory structure. No production code or public API changes are introduced. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Composer
participant PHPUnit
participant Project
Developer->>Composer: Remove PHPSpec dependency
Developer->>Project: Update test namespaces and directories
Developer->>PHPUnit: Run tests (now from ./test/ and ./tests/)
PHPUnit->>Project: Discover and execute tests
Possibly related PRs
Suggested labels
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
72f93e2 to
a905be2
Compare
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
a905be2 to
defbc11
Compare
2f42b8a to
ec56db0
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist (1)
13-14: Consider removing legacytest/directory mapping
If the oldtest/directory is no longer in use, removing<directory>./test/</directory>will reduce confusion and speed up test discovery.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
phpstan.neon.dist(1 hunks)src/Sylius/Bundle/CurrencyBundle/composer.json(1 hunks)src/Sylius/Bundle/CurrencyBundle/phpspec.yml.dist(0 hunks)src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist(1 hunks)src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php(1 hunks)src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php(1 hunks)src/Sylius/Bundle/CustomerBundle/composer.json(0 hunks)src/Sylius/Bundle/CustomerBundle/phpspec.yml.dist(0 hunks)src/Sylius/Bundle/TaxonomyBundle/composer.json(0 hunks)src/Sylius/Bundle/TaxonomyBundle/phpspec.yml.dist(0 hunks)
💤 Files with no reviewable changes (5)
- src/Sylius/Bundle/CustomerBundle/phpspec.yml.dist
- src/Sylius/Bundle/TaxonomyBundle/composer.json
- src/Sylius/Bundle/TaxonomyBundle/phpspec.yml.dist
- src/Sylius/Bundle/CurrencyBundle/phpspec.yml.dist
- src/Sylius/Bundle/CustomerBundle/composer.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php (1)
src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php (1)
AsCurrencyContext(19-26)
🔇 Additional comments (7)
src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php (1)
14-14: Aligns with PSR-4 autoload mapping
Namespace updated toTests\Sylius\Bundle\CurrencyBundle\Stubmatches theautoload-devPSR-4 configuration incomposer.json.src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist (1)
13-15: Include newtests/directory for PHPUnit
Adding<directory>./tests/</directory>ensures PHPUnit discovers tests in the consolidatedtests/folder.phpstan.neon.dist (1)
19-19: Exclude newtests/path from analysis
The pattern**/Bundle/*/tests/**.phpcorrectly extends PHPStan exclusions to the consolidated test directory.src/Sylius/Bundle/CurrencyBundle/composer.json (2)
67-67: Consolidate test PSR-4 autoloading
Mapping"Tests\\Sylius\\Bundle\\CurrencyBundle\\": "tests/"simplifies the dev autoload section by unifying specs and tests under one namespace.
69-71:Details
✅ Verification successful
Verify
classmappath for AppKernel
The classmap entry still points totest/app/AppKernel.php, but the directory may have been migrated totests/app. Please confirm the file’s location or update this path accordingly.Run:
🏁 Script executed:
#!/bin/bash # Ensure AppKernel is found in the expected location if [ -f test/app/AppKernel.php ]; then echo "Legacy AppKernel path found" elif [ -f tests/app/AppKernel.php ]; then echo "AppKernel moved to tests/app/AppKernel.php – please update classmap" else echo "AppKernel.php not found in test/app or tests/app" exit 1 fiLength of output: 188
🏁 Script executed:
#!/bin/bash # Locate AppKernel.php anywhere in the repository echo "Searching for AppKernel.php in the repo..." find . -type f -iname "AppKernel.php"Length of output: 1230
classmap path for AppKernel is correct
Thetest/app/AppKernel.phpfile exists atsrc/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php, so theclassmapentry incomposer.jsondoes not need updating.src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php (2)
14-14: Align test namespace with PSR-4 mapping
Updated namespace toTests\Sylius\Bundle\CurrencyBundle\DependencyInjectionto match theautoload-devconfiguration.
21-21: UpdateCurrencyContextStubimport path
Adjusted import toTests\Sylius\Bundle\CurrencyBundle\Stub\CurrencyContextStub, consistent with the stub’s new namespace.
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.
PHPUnit schema location can be changed to the local vendor in order to avoid changing it for each updated version.
Summary by CodeRabbit
Chores
Refactor