From 7d79c09f2e491fa884f49f5e8dd05b32a0c22c37 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 10 Apr 2026 14:31:34 +0200 Subject: [PATCH 1/2] [DeepClone] Remove tidyNode from NOT_ROUND_TRIPPABLE (now supported via probe) --- src/DeepClone/DeepClone.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DeepClone/DeepClone.php b/src/DeepClone/DeepClone.php index 1f90ecbc..108bd523 100644 --- a/src/DeepClone/DeepClone.php +++ b/src/DeepClone/DeepClone.php @@ -25,7 +25,6 @@ final class DeepClone 'XMLReader' => true, 'SNMP' => true, 'tidy' => true, - 'tidyNode' => true, ]; private static array $reflectors = []; From c7b2ba69d80ac85c5d1c6e4002f76b97580450b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 10 Apr 2026 14:32:27 +0200 Subject: [PATCH 2/2] [DeepClone] Test deepclone of tidyNode (final internal class without serialization API) --- tests/DeepClone/DeepCloneTest.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/DeepClone/DeepCloneTest.php b/tests/DeepClone/DeepCloneTest.php index 53cf7628..c31085b7 100644 --- a/tests/DeepClone/DeepCloneTest.php +++ b/tests/DeepClone/DeepCloneTest.php @@ -1044,6 +1044,31 @@ public function testRoundTripWithAllowedClasses() $this->assertSame(1, $c->x); } + // ───────────────────────────────────────────────────────────────────── + // deepclone_rule_a_probe.phpt — final internal classes without serialization API + // ───────────────────────────────────────────────────────────────────── + + /** + * @requires extension tidy + */ + public function testTidyNodeRoundTrip() + { + $tidy = new \tidy(); + $tidy->parseString('

hello

', [], 'utf8'); + $b = $tidy->body()->child[0]->child[0]; // node + + $clone = deepclone_from_array(deepclone_to_array($b)); + + $this->assertInstanceOf(\tidyNode::class, $clone); + $this->assertNotSame($b, $clone); + $this->assertSame($b->name, $clone->name); + $this->assertSame($b->value, $clone->value); + } + + // ───────────────────────────────────────────────────────────────────── + // deepclone_mongodb.phpt — MongoDB BSON types round-trip + // ───────────────────────────────────────────────────────────────────── + /** * @requires extension mongodb */