diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php index b9c6817988032..8c22ce1fa00c4 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php @@ -2914,4 +2914,14 @@ public function test_unclosed_funky_comment_input_too_short() { $this->assertFalse( $processor->next_tag() ); $this->assertTrue( $processor->paused_at_incomplete_token() ); } + + public function test_next_tag_issue_for_trunk_and_php83() { + $picture_markup = '

Green Leaves

'; + $picture_processor = new WP_HTML_Tag_Processor( $picture_markup ); + $this->assertFalse( $picture_processor->next_tag( array( 'tag_name' => 'PICTURE' ) ), 'There should not be a PICTURE tag.' ); + + $picture_processor = new WP_HTML_Tag_Processor( $picture_markup ); + $picture_processor->next_tag( array( 'tag_name' => 'IMG' ) ); + $this->assertStringEndsWith( '.webp', $picture_processor->get_attribute( 'src' ), 'Make sure the IMG should return WEBP src.' ); + } }