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

[PhpUnitBridge] Fix tests with @doesNotPerformAssertions annotations #40957

Merged
merged 1 commit into from
May 7, 2021

Conversation

alexpott
Copy link
Contributor

@alexpott alexpott commented Apr 27, 2021

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

If a test uses the @doesNotPerformAssertions and also has the Symfony Deprecation listener enabled because it is using the trait as well then this does not work as expected. Currently the bridge is checking this annotation/setting prior to running the test. This results in:

  • Tests not working as expected when $this->expectNotToPerformAssertions() is called during a test
  • If this is being used to ensure that a test does not perform an assertion then due to the bridge the test will no longer be marked as risky because we call $test->getTestResultObject()->beStrictAboutTestsThatDoNotTestAnything(false);

@carsonbot carsonbot changed the title Fix tests with @doesNotPerformAssertions annotations [PhpUnitBridge] Fix tests with @doesNotPerformAssertions annotations Apr 27, 2021
@carsonbot
Copy link

Hey!

I think @fancyweb has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@OskarStark OskarStark changed the title [PhpUnitBridge] Fix tests with @doesNotPerformAssertions annotations [PhpUnitBridge] Fix tests with @doesNotPerformAssertions annotations Apr 29, 2021
@nicolas-grekas nicolas-grekas added this to the 5.2 milestone May 7, 2021
@nicolas-grekas nicolas-grekas changed the base branch from 5.x to 5.2 May 7, 2021 12:56
@nicolas-grekas
Copy link
Member

Thank you @alexpott.

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.

None yet

5 participants