From da6f716c410b9fd42f16896309a4ec2071f15632 Mon Sep 17 00:00:00 2001 From: Isabelle Hurbain-Palatin Date: Thu, 16 May 2024 11:59:53 +0200 Subject: Fix serialization errors in PageBundle extensiondata When going through a ContentDOMTransformStage, we try to move the PageBundle when transforming the document from and to DOM. In the current version of this code, this adds DataParsoid, a non-serializable class, to ExtensionData, which breaks on ParserCache storage in later steps. This patch is pretty hacky, but it transforms the PageBundle structure back to a stdClass so that it can be re-serialized before cache insertion. The added test fails without this patch. Hopefully we'll get rid of these hacks when using a HTMLHolder later. Bug: T365036 Change-Id: Icc74edd43ea5098faebc21a084b6d483d6ab99d1 --- tests/common/TestsAutoLoader.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/common') diff --git a/tests/common/TestsAutoLoader.php b/tests/common/TestsAutoLoader.php index 1a95a49c4da2..90b040e75604 100644 --- a/tests/common/TestsAutoLoader.php +++ b/tests/common/TestsAutoLoader.php @@ -148,6 +148,7 @@ $wgAutoloadClasses += [ 'LogFormatterTestCase' => "$testDir/phpunit/includes/logging/LogFormatterTestCase.php", # tests/phpunit/includes/OutputTransform + 'MediaWiki\\Tests\\OutputTransform\\DummyDOMTransformStage' => "$testDir/phpunit/includes/OutputTransform/DummyDOMTransformStage.php", 'MediaWiki\\Tests\\OutputTransform\\TestUtils' => "$testDir/phpunit/includes/OutputTransform/TestUtils.php", 'MediaWiki\\Tests\\OutputTransform\\OutputTransformStageTestBase' => "$testDir/phpunit/includes/OutputTransform/OutputTransformStageTestBase.php", -- cgit v1.2.3