Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

HypeMC
Copy link
Member

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

This PR adds the ability to configure clock and DNS mock namespaces through attributes, removing the need to add them tophpunit.xml:

#[DnsSensitive(Foo::class)]class FooTestextends KernelTestCase{    #[TimeSensitive(Bar::class)]publicfunctiontestFoo()    {// ...    }}

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/ -eForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {}
Copy link
MemberAuthor

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;
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Minor optimization

@HypeMCHypeMCforce-pushed thephpunit-bridge-attributes branch 2 times, most recently from3199197 to54c59f7CompareJanuary 7, 2025 08:33
@HypeMCHypeMCforce-pushed thephpunit-bridge-attributes branch from54c59f7 to42cc6d2CompareJanuary 7, 2025 08:53
Copy link
Member

@nicolas-grekasnicolas-grekas left a 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)

@HypeMCHypeMCforce-pushed thephpunit-bridge-attributes branch from42cc6d2 to130cc26CompareJanuary 7, 2025 09:45
@nicolas-grekas
Copy link
Member

Thank you@HypeMC.

@nicolas-grekasnicolas-grekas merged commit4c071c2 intosymfony:7.3Jan 7, 2025
6 of 12 checks passed
@HypeMCHypeMC deleted the phpunit-bridge-attributes branchJanuary 7, 2025 11:15
chalasr added a commit that referenced this pull requestJan 11, 2025
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       | MITFollow-up to#59384Didn'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
@fabpotfabpot mentioned this pull requestMay 2, 2025
fabpot added a commit that referenced this pull requestMay 24, 2025
…butes (HypeMC)This PR was merged into the 7.3 branch.Discussion----------[PhpUnitBridge] Fix cleaning up mocked features with attributes| Q             | A| ------------- | ---| Branch?       | 7.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITFixes usage of the attributes introduced in#59384 to reflect changes made in#60484.Commits-------62da782 [PhpUnitBridge] Fix cleaning up mocked features with attributes
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@xabbuhxabbuhxabbuh left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

4 participants
@HypeMC@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp