-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Relate deprecations from DataProvider with corresponding tests #6293
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
Conversation
1ad4f07
to
cc7cef6
Compare
use PHPUnit\Framework\Attributes\Test; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class TriggersDeprecationInDataProviderTest extends TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can add a case where two tests relate to the same data provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more tests
You might be right. I will let this decision to Sebastian |
As commented in #6279 (comment) this change would unblock Symfony to use PHPUnit > 12.1. I think it could be worse to expand the tests with a test that uses the I was also wondering how PHPUnit behaves if you use the same data provider with both tests ignoring deprecations as well as not ignoring them. The result looks expected to me but it may also be worth adding a test for that (maybe also doing two distinct cases to prove that the order doesn't matter, i.e. the behaviour is the same no matter if the ignoring deprecations test comes before or after the not ignoring test inside the test class). |
@xabbuh please suggest/PR concrete test examples you have in mind |
Cherry-picked into |
fixes #6279
idea is, that we relate deprecations when triggered while building a dataprovider to the corresponding test
we cannot use
$test = Event\Code\TestMethodBuilder::fromCallStack();
to infer the test-contex, as the dataprovider is built before we enter the actual test