-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Static data providers required in PHPUnit 10 #7117
Comments
We could probably use
Do they need to be tracked? If they don’t have any assertions that should not be needed I think. |
I don‘t know. The |
I think it would be better to pass the mock object data from the generator method to the test method, and create the mock in there. or simply fix it like #7150 |
Description ----------- see contao/contao#7117 Commits ------- d00665c0 Make EntityCacheTagsTest compatible with PHPUnit 10
Description
PHPUnit 10 requires all data providers to be static, however, we have about 40 that use
$this->createMock()
or$this->mockClassWithProperties()
. For example:contao/core-bundle/tests/Cache/EntityCacheTagsTest.php
Lines 146 to 166 in f7f4cdc
I have no idea how to fix this without encapsulating the code in a separate test method. We could of course replace every
$this->createMock()
with(new class() extends TestCase {})->createMock()
in the static methods, but then these doubled types would no longer be tracked in the original test case object.The text was updated successfully, but these errors were encountered: