Problem/Motivation
The rollback of #2575105: Use cache collector for state revealed that our testing of adding shutdown functions in shutdown functions is incomplete. Whilst \Drupal\Tests\system\Functional\System\ShutdownFunctionsTest
tests this it is vulnerable to changes to core that add or remove shutdown functions. Therefore we should add a KernelTest that eliminates this and asserts that we are working with a clean slate.
Proposed resolution
Add a kernel test to test adding shutdown functions in shutdown functions. I don't think we should remove \Drupal\Tests\system\Functional\System\ShutdownFunctionsTest
because that has extra test coverage around different web server set ups where shutdown functions are triggered after the server has sent the response to the browser.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 3008140-2.patch | 1.96 KB | alexpott |
#3 | 3008140-3.revert.patch | 13.06 KB | alexpott |
#2 | 3008140-2.patch | 1.96 KB | alexpott |
Comments
Comment #2
alexpottHere's a test that would have failed when we made the breaking change - which was #2885309: [PHP 7.2] each() function is deprecated - the way in which we converted to a foreach was wrong. See https://3v4l.org/le78R - it broke on PHP 5 (but not on PHP 7 where a bugfix has been implemented). The fix for this has been committed in #2575105: Use cache collector for state
Comment #3
alexpottHere's a patch that reverts both commits on #2575105: Use cache collector for state - ie. 7fcabc7ad6 and 8861a546b8 so we're back to where we were before the revert commit to show the new test would fall on PHP5 whilst all other tests including
\Drupal\Tests\system\Functional\System\ShutdownFunctionsTest
should pass.Re-uploading #2 too so the latest patch is the one that should be reviewed.
Comment #7
BerdirTest makes sense, still applies and still passes.
Comment #9
catchCommitted 3eaacac and pushed to 9.1.x. Thanks!