Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Found in #3063887: Support PHPUnit 8 in Drupal 9, drop support for PHPUnit 7.
Problem/Motivation
ViewExecutableTest has mock expectation fails in PHPUnit8 due to callback return type should be bool and not string.
The callback return type is signed for PHPUnit 8, and it currently returns a string being the argument passed in - which is not necessary.
Proposed resolution
Use $this->anything()
as expected argument in place of the callback.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3102899-2.patch | 1.17 KB | mondrake |
Comments
Comment #2
mondrakePatch.
Comment #3
LendudeThis is good.
Comment #4
mondrakeI have some doubts on these tests... what's the purpose of looping through
to have
? In the end, it will just pass if the method is only called once, but I suppose we expect at least to be called once per handler.
Note this is so already in HEAD, this is not related to the change here.
Comment #8
catchCommitted/pushed to 9.0.x/8.9.x/8.8.x, thanks! @mondrake could you open a follow-up for the issue noticed in #4, i don't think we should fix it here but worth looking at it properly.
Comment #9
mondrakeFiled #3103913: ViewExecutableTest::testAddHandler and ::testAddHandlerWithEntityField are misusing the mock expectation.