Problem/Motivation
Using Prophecy to implement Serializable will cause deprecations on PHP 8.1.
Steps to reproduce
Run core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php on PHP 8.1
Run core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php on PHP 8.1
Proposed resolution
Add objects the implement __serialize() to the test's namespace
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3240888-9.patch | 2.89 KB | alexpott |
| #9 | 8-9-interdiff.txt | 1.23 KB | alexpott |
Comments
Comment #2
andypostusing patch from https://git.drupalcode.org/project/drupal/-/commit/46579a8cd9a1af5280882...
Comment #3
andypostAnd the remains of commit
Comment #4
andypostRe-upload #2 as
DeprecationListenerTraitalready has no such changesComment #5
alexpottI wrote this code on the metas issue #3220021: [meta] Ensure compatibility of Drupal 9 with PHP 8.1 (as it evolves).
Let's also do core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php here too as it fails for the same reason.
Comment #6
andypostGreat catch, confirm fix
Comment #7
larowlanunused?
do we need to prophesize if we've got a test dummy?
Comment #8
andypostRe #7
1) it's used in extends
UnserializableTranslationManager extends TranslationManager2) yes, no need, the magic happens because
$translation_service->_serviceId = 'string_translation';Comment #9
alexpottLet's decouple from the constructor too.
Comment #10
andypostChecked test locally - works perfect and a bit cleaner, bot should be green. thank you
Comment #12
andypostre-queued after https://www.drupal.org/pift-ci-job/2198523
Comment #13
andypostComment #14
andypostback to RTBC
Comment #16
larowlanCommitted a19e993 and pushed to 9.3.x. Merci beaucoup!