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

Add PHPUnit 10+ attributes #1386

Merged
merged 1 commit into from Mar 1, 2024
Merged

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Mar 1, 2024

Fixes #1359

While upgrading to PHPUnit 11 I noticed the following deprecation:

Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.

If we add the attribute too, it stops complaining. So this most be a way to support PHPUnit 11 and older versions.

If we ship this, we reduce a few errors. Most of the things just work fine.

Fixes mockery#1359

While upgrading to PHPUnit 11 I noticed the following deprecation:

Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12.
Update your test code to use attributes instead.

If we add the attribute too, it stops complaining. So this most be a way to support PHPUnit 11
and older versions.

If we ship this, we reduce a few errors. Most of the things just work fine.
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.03%. Comparing base (2505d9c) to head (8123e5c).

Additional details and impacted files
@@            Coverage Diff            @@
##              1.6.x    #1386   +/-   ##
=========================================
  Coverage     78.03%   78.03%           
  Complexity     1021     1021           
=========================================
  Files            76       76           
  Lines          2632     2632           
=========================================
  Hits           2054     2054           
  Misses          578      578           
Files Coverage Δ
...kery/Adapter/Phpunit/MockeryPHPUnitIntegration.php 90.47% <100.00%> (ø)

@ghostwriter ghostwriter added Patch Backwards compatible bug fixes and improvements Chore for non-functional changes or maintenance tasks such as code cleanup, formatting, or dependency upda labels Mar 1, 2024
@ghostwriter ghostwriter added this to the 1.6.8 milestone Mar 1, 2024
Copy link
Member

@ghostwriter ghostwriter left a comment

Choose a reason for hiding this comment

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

Looks good to me, @ruudk

Thank you.

@ghostwriter
Copy link
Member

GitHub is partially down right now,

"degraded performance for Pull Requests and Actions:" https://www.githubstatus.com/incidents/wcl1sw4mzg60

I’ll restart GitHub Action and merge this once CI completes.

@ghostwriter
Copy link
Member

for the record...

When both /** @before */ and #[Before] are used then 1) the before-test method is called only once and 2) the deprecation is not emitted.

sebastianbergmann/phpunit#5695 (comment)

@ghostwriter ghostwriter merged commit e7e2f3f into mockery:1.6.x Mar 1, 2024
18 of 22 checks passed
@westy92
Copy link

westy92 commented Mar 10, 2024

Thanks for fixing this! Looking forward to the release. 🚀

@ghostwriter ghostwriter added the enhancement new feature label Mar 11, 2024
@ghostwriter ghostwriter mentioned this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore for non-functional changes or maintenance tasks such as code cleanup, formatting, or dependency upda enhancement new feature Patch Backwards compatible bug fixes and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecations about drop support Metadata doc-comment in PHPUnit 12
3 participants