Skip to content

Commit ba54ae4

Browse files
committed
Remove JSON_THROW_ON_ERROR constant
1 parent cdba027 commit ba54ae4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ public function test_complex_javascript_and_json_auto_escaping() {
559559
);
560560

561561
$processor->set_modifiable_text( $importmap );
562-
$decoded_importmap = json_decode( $processor->get_modifiable_text(), true, 512, JSON_THROW_ON_ERROR );
562+
$decoded_importmap = json_decode( $processor->get_modifiable_text(), true );
563+
$this->assertSame( JSON_ERROR_NONE, json_last_error(), 'Precondition failed, JSON did not decode as expected: ' . json_last_error_msg() );
563564
$this->assertEquals(
564565
$importmap_data,
565566
$decoded_importmap,
@@ -602,7 +603,8 @@ public function test_json_auto_escaping() {
602603
// This is not a typical JSON encoding or escaping, but it is valid.
603604
$json_text = '"Escaped BS: \\\\; Escaped BS+LT: \\\\<; Unescaped LT: <; Script closer: </script>"';
604605
$expected_decoded_json = 'Escaped BS: \\; Escaped BS+LT: \\<; Unescaped LT: <; Script closer: </script>';
605-
$decoded_json = json_decode( $json_text, false, 512, JSON_THROW_ON_ERROR );
606+
$decoded_json = json_decode( $json_text, true );
607+
$this->assertSame( JSON_ERROR_NONE, json_last_error(), 'Precondition failed, JSON did not decode as expected: ' . json_last_error_msg() );
606608
$this->assertSame(
607609
$expected_decoded_json,
608610
$decoded_json,

0 commit comments

Comments
 (0)