post( array( 'id' => '42', 'post_type' => 'post', 'post_title' => "Hello\nWorld", 'post_content' => '

Keep HTML

', 'post_excerpt' => 'Excerpt', 'post_status' => 'publish', 'post_name' => 'hello-world', 'post_parent' => '7', 'menu_order' => '3', 'meta' => array( '_source_url' => 'https://source.test/page', ), ) ); self::assertSame( array( 'id' => 42, 'post_type' => 'post', 'post_title' => 'Hello World', 'post_content' => '

Keep HTML

', 'post_excerpt' => 'Excerpt', 'post_status' => 'publish', 'post_name' => 'hello-world', 'post_parent' => 7, 'menu_order' => 3, 'meta' => array( '_source_url' => 'https://source.test/page', ), ), $record ); } public function test_it_normalizes_term_records(): void { $normalizer = new ContentRecordNormalizer(); $record = $normalizer->term( array( 'id' => '9', 'taxonomy' => 'category', 'name' => "News\nUpdates", 'slug' => 'news-updates', 'description' => '

Keep description HTML

', 'parent' => '2', 'meta' => array( 'landing_url' => 'https://source.test/news', ), ) ); self::assertSame( array( 'id' => 9, 'taxonomy' => 'category', 'name' => 'News Updates', 'slug' => 'news-updates', 'description' => '

Keep description HTML

', 'parent' => 2, 'meta' => array( 'landing_url' => 'https://source.test/news', ), ), $record ); } public function test_it_normalizes_media_records(): void { $normalizer = new ContentRecordNormalizer(); $record = $normalizer->media( array( 'id' => '12', 'post_title' => "Hero\nImage", 'post_mime_type' => 'image/jpeg', 'source_url' => 'https://source.test/uploads/hero.jpg', 'metadata' => array( 'width' => 1200, ), 'meta' => array( '_wp_attachment_image_alt' => 'Hero', ), ) ); self::assertSame( array( 'id' => 12, 'post_title' => 'Hero Image', 'post_mime_type' => 'image/jpeg', 'source_url' => 'https://source.test/uploads/hero.jpg', 'metadata' => array( 'width' => 1200, ), 'meta' => array( '_wp_attachment_image_alt' => 'Hero', ), ), $record ); } }