@@ -319,9 +319,15 @@ public function test_basic_assertion_cdata_section() {
319319 $ processor ->next_token ();
320320
321321 $ this ->assertSame (
322- '#cdata-section ' ,
322+ '#comment ' ,
323323 $ processor ->get_token_name (),
324- "Should have found CDATA section name but found {$ processor ->get_token_name ()} instead. "
324+ "Should have found comment token but found {$ processor ->get_token_name ()} instead. "
325+ );
326+
327+ $ this ->assertSame (
328+ WP_HTML_Processor::COMMENT_AS_CDATA_LOOKALIKE ,
329+ $ processor ->get_comment_type (),
330+ 'Should have detected a CDATA-like invalid comment. '
325331 );
326332
327333 $ this ->assertNull (
@@ -405,20 +411,21 @@ public function test_basic_assertion_processing_instruction() {
405411 $ processor ->next_token ();
406412
407413 $ this ->assertSame (
408- '#processing-instruction ' ,
409- $ processor ->get_token_type (),
410- "Should have found PI node but found {$ processor ->get_token_type ()} instead. "
414+ '#comment ' ,
415+ $ processor ->get_token_name (),
416+ "Should have found comment token but found {$ processor ->get_token_name ()} instead. "
411417 );
412418
413419 $ this ->assertSame (
414- ' wp-bit ' ,
415- $ processor ->get_token_name (),
416- " Should have found PI target as name but found { $ processor -> get_token_name ()} instead. "
420+ WP_HTML_Processor:: COMMENT_AS_PI_NODE_LOOKALIKE ,
421+ $ processor ->get_comment_type (),
422+ ' Should have detected a Processing Instruction-like invalid comment. '
417423 );
418424
419- $ this ->assertNull (
425+ $ this ->assertSame (
426+ 'wp-bit ' ,
420427 $ processor ->get_tag (),
421- ' Should not have been able to query tag name on non-element token. '
428+ " Should have found PI target as tag name but found { $ processor -> get_tag ()} instead. "
422429 );
423430
424431 $ this ->assertNull (
0 commit comments