-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] Enable configuring mock namespaces with attributes #59384
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
Conversation
run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {} | ||
run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e /Attribute/ -e /Extension/ -e /Metadata/ -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {} |
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 10+ is PHP >=8.1, so it should be ok for the extension classes to use PHP >=8 syntax.
@@ -33,7 +40,12 @@ public function notify(Finished $event): void | |||
foreach ($test->metadata() as $metadata) { | |||
if ($metadata instanceof Group && 'time-sensitive' === $metadata->groupName()) { | |||
ClockMock::withClockMock(false); | |||
break; |
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.
Minor optimization
src/Symfony/Bridge/PhpUnit/Extension/RegisterClockMockSubscriber.php
Outdated
Show resolved
Hide resolved
3199197
to
54c59f7
Compare
54c59f7
to
42cc6d2
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.
LGTM (after composer.json change is reverted)
42cc6d2
to
130cc26
Compare
Thank you @HypeMC. |
This PR was merged into the 7.3 branch. Discussion ---------- [PhpUnitBridge] Mark `AttributeReader` as internal | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Follow-up to #59384 Didn't notice this in my original PR, but it'd make sense for the `AttributeReader` class to be marked as internal. Commits ------- ba073c2 [PhpUnitBridge] Mark `AttributeReader` as internal
This PR adds the ability to configure clock and DNS mock namespaces through attributes, removing the need to add them to
phpunit.xml
: