Fix PHP Warning: serialize() in tests on PHP 8

Created on 11 November 2022, over 1 year ago
Updated 16 February 2023, over 1 year ago

Problem/Motivation

Our test runs currently output an error like the following on 8.x-2.x:

15:40:37 Drupal\Tests\automatic_updates\Kernel\StatusCheck\StagedData   7 passes                                      
15:40:37 PHP Warning:  serialize(): Double\Drupal\Core\StringTranslation\TranslatableMarkup\P1::__sleep() should return an array only containing the names of instance-variables to serialize in /var/www/html/sites/simpletest/TestCase.php on line 853

We shouldn't tolerate PHP warnings (or notices, for that matter) in our code. Let's fix it.

Steps to reproduce

Example at https://dispatcher.drupalci.org/job/drupal8_contrib_patches/131471/console

πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States TravisCarden

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024