Skip to content
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

Remove SymfonyTestsListener configuration #7432

Draft
wants to merge 1 commit into
base: 2.5
Choose a base branch
from

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented May 16, 2024

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes
Related issues/PRs related #7339
License MIT
Documentation PR

What's in this PR?

Removing SymfonyTestsLister since it's being removed in PhpUnit 10 anyways.

Why?

see above

@mamazu mamazu mentioned this pull request May 16, 2024
1 task
@alexander-schranz alexander-schranz changed the base branch from 2.6 to 2.5 May 16, 2024 16:14
@alexander-schranz alexander-schranz added the DX Affecting the end developer label May 16, 2024
@alexander-schranz alexander-schranz changed the title Removing SymfonyTestsLister (for phpunit 10) update Remove SymfonyTestsListener configuration May 16, 2024
@mamazu
Copy link
Contributor Author

mamazu commented May 16, 2024

Why do the tests break when I change the XML?

@alexander-schranz
Copy link
Member

alexander-schranz commented May 17, 2024

@mamazu I don't know maybe some tests relay on some functionality of the bridge: https://symfony.com/doc/current/components/phpunit_bridge.html.

But as a I know there should be for all things a replacement in PHPUnit itself or a way to workaround it https://thephp.cc/presentations/phpunit-10-for-symfony-developers

Lets check if we can change the two tests to work again on 2.5 without the listener.

@mamazu
Copy link
Contributor Author

mamazu commented May 17, 2024

It looks like the problem is "perserveGlobalState". This should be off for isolated processes anyways (see: sebastianbergmann/phpunit#3954) which is probably why it runs in phpunit 10.

So what to do:

  • But for the old phpunit 9 we would have to find a way to generate a listener that disabled this feature for all tests
  • Introduce a base setUp method in the SuluTestcase (which could be removed when migrating to phpunit 10 anways).

But I'm open for suggestions. The line that is currently fixing that is here:
https://github.com/symfony/symfony/blob/c1bca297cf15145fff29ee169e9820ffacc5d37d/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php#L121-L123

@mamazu mamazu marked this pull request as draft May 18, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants