Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
base system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2021 at 21:58 UTC
Updated:
6 Dec 2021 at 12:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
daffie commentedThe fix.
Comment #3
andypostdoes it mean that prophecy (mocking) may hit us other tests too?
The fix looks valid, please elaborate if it makes sense to stop using prophecy in contrib/custom tests
Comment #4
andypostOr it's only specific to RequestContext?
Comment #5
daffie commentedThe problem is when you are using the return type hint "static" and use Prophecy in testing on that code. You will get the error message from the IS. There is an issue for getting this bug fixed. The problem is that the bug is not fixed at the moment and we cannot start with Symfony 6 in the 10.0.x branch. My idea was to change the use of prophecy to mocking. In that way we can start with Symfony 6 in D10. A kind of quick fix. You can do the same in contrib/custom when you have the same problem and cannot wait until the problem is fixed in Prophecy. See: https://github.com/phpspec/prophecy/issues/527.
Edit: With this change the testbot is green for 9.4.x with Symfony 5.4. No other changes are necessary for core on this problem. See: #3161889-204: [META] Symfony 6 compatibility.
Comment #6
andypostThank you, the patch makes sense ATM (while no fix for prophecy)
Comment #7
longwave+1 to the fix, sometimes having two entirely separate object mocking frameworks available to us is a feature rather than a bug :)
Comment #9
catchCommitted/pushed to 9.4.x, thanks!