Skip to content

[PhpUnitBridge] Fix cleaning up mocked features with attributes #60500

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

Merged
merged 1 commit into from
May 24, 2025

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented May 21, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Fixes usage of the attributes introduced in #59384 to reflect changes made in #60484.

@@ -50,35 +52,51 @@ public function bootstrap(Configuration $configuration, Facade $facade, Paramete

$facade->registerSubscriber(new RegisterClockMockSubscriber($reader));
$facade->registerSubscriber(new EnableClockMockSubscriber($reader));
$facade->registerSubscriber(new class implements ErroredSubscriber {
$facade->registerSubscriber(new class($reader) implements ErroredSubscriber {
public function __construct(private AttributeReader $reader)
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I wanted to use the same instance of the reader was to leverage its internal cache. Perhaps moving the disableClockMock, disableDnsMock, and hasGroup methods to an abstract subscriber class would be better?

@xabbuh
Copy link
Member

xabbuh commented May 22, 2025

looking at the CI failure we should probably also exclude the SymfonyExtension class from the PHP 7.2 linter (it requires PHPUnit 10+ which in turn requires PHP 8.1+)

@HypeMC HypeMC force-pushed the fix-symfonyextension-with-attributes branch from 990d750 to 62da782 Compare May 23, 2025 07:26
@HypeMC
Copy link
Member Author

HypeMC commented May 23, 2025

@xabbuh Don't know why I didn't do that from the start: https://github.com/symfony/symfony/compare/990d750552cd0e84af2d55076805a35ac99ea615..62da782fd3941e75bf150a52eebb6935623ad814

@fabpot
Copy link
Member

fabpot commented May 24, 2025

Thank you @HypeMC.

@fabpot fabpot merged commit f3247fd into symfony:7.3 May 24, 2025
10 of 12 checks passed
@HypeMC HypeMC deleted the fix-symfonyextension-with-attributes branch May 24, 2025 14:09
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.

4 participants