Skip to content

Commit 369eefc

Browse files
committed
Use the updated_html value in round-trip test
1 parent d8c320c commit 369eefc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public function test_complex_javascript_and_json_auto_escaping() {
582582
$updated_html = $processor->get_updated_html();
583583
$this->assertEqualHTML( $expected, $updated_html );
584584

585-
// Re-process and verify the JSON is correct.
585+
// Reprocess to ensure JSON survives HTML round-trip:
586586
$processor = new WP_HTML_Tag_Processor( $updated_html );
587587
$processor->next_tag( 'SCRIPT' );
588588
$this->assertSame( 'importmap', $processor->get_attribute( 'type' ) );
@@ -625,8 +625,8 @@ public function test_json_auto_escaping() {
625625
$updated_html = $processor->get_updated_html();
626626
$this->assertEqualHTML( $expected, $updated_html );
627627

628-
// Reprocess to ensure JSON value survives HTML round trip:
629-
$processor = new WP_HTML_Tag_Processor( $expected );
628+
// Reprocess to ensure JSON value survives HTML round-trip:
629+
$processor = new WP_HTML_Tag_Processor( $updated_html );
630630
$processor->next_tag( 'SCRIPT' );
631631
$decoded_json_from_html = json_decode( $processor->get_modifiable_text(), true );
632632
$this->assertSame( JSON_ERROR_NONE, json_last_error(), 'JSON failed to decode.' );

0 commit comments

Comments
 (0)