fix: preserve serialized object payloads

This commit is contained in:
Keith Solomon
2026-04-26 14:57:48 -05:00
parent 4cfc1036bb
commit d50917d827
2 changed files with 29 additions and 1 deletions
@@ -100,6 +100,13 @@ class MetadataUrlTransformerTest extends TestCase {
self::assertSame( $value, $transformer->transformValue( $value, $this->mappings() ) );
}
public function test_it_leaves_serialized_payloads_with_nested_objects_unchanged(): void {
$transformer = new MetadataUrlTransformer( new UrlTransformer() );
$value = 'a:2:{s:3:"url";s:28:"https://example.test/inside";s:6:"object";O:8:"stdClass":0:{}}';
self::assertSame( $value, $transformer->transformValue( $value, $this->mappings() ) );
}
public function test_it_leaves_invalid_json_strings_unchanged(): void {
$transformer = new MetadataUrlTransformer( new UrlTransformer() );
$value = '{"url":"https://example.test/missing"';