spatie / phpunit-snapshot-assertions

A way to test without writing actual test cases
https://spatie.be/courses/testing-laravel-with-pest/snapshot-testing
MIT License
640 stars 70 forks source link

Change `@after` to `@postCondition` #168

Closed mfn closed 1 year ago

mfn commented 1 year ago

Summary

The former will not work with 10.1 anymore, according to phpunit this was an unintended side effect, see https://github.com/sebastianbergmann/phpunit/issues/5337#issuecomment-1513000069

Fixes https://github.com/spatie/phpunit-snapshot-assertions/issues/167

Notes

The test suite in this framework does not cover the presence of this phpdoc (when I removed it, all tests were still green).

Upfront I tested this in a local installation of phpunit-snapshot-assertions (though it was an older version, still using PHP 7.4 there), but I could already confirm even for that version and PHPUnit <10 in that case, it worked.

mfn commented 1 year ago

Though would be great if someone else can practically test this in their installation (even modifying vendor files locally, to be sure), that would appreciated 🙏🏼

timvandijck commented 1 year ago

Hey @mfn thank you for allready testing this out and making the PR. It looks like a promising sollution. I'll do some testing myself and merge the PR if everything checks out.

mfn commented 1 year ago

Thank you!