Skip to content

Commit e83ff85

Browse files
committed
Update tests
1 parent 4e0c799 commit e83ff85

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,26 +557,32 @@ public function test_next_tag_should_stop_on_rcdata_and_script_tag_closers_when_
557557
$p = new WP_HTML_Tag_Processor( '<script>abc</script>' );
558558

559559
$p->next_tag();
560-
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </script> tag closer' );
561-
$this->assertTrue( $p->is_tag_closer(), 'Indicated a <script> tag opener is a tag closer' );
560+
$this->assertFalse(
561+
$p->next_tag( array( 'tag_closers' => 'visit' ) ),
562+
'Should not have found closing SCRIPT tag when closing an opener.'
563+
);
562564

563565
$p = new WP_HTML_Tag_Processor( 'abc</script>' );
564566
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </script> tag closer when there was no tag opener' );
565567

566568
$p = new WP_HTML_Tag_Processor( '<textarea>abc</textarea>' );
567569

568570
$p->next_tag();
569-
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </textarea> tag closer' );
570-
$this->assertTrue( $p->is_tag_closer(), 'Indicated a <textarea> tag opener is a tag closer' );
571+
$this->assertFalse(
572+
$p->next_tag( array( 'tag_closers' => 'visit' ) ),
573+
'Should not have found closing TEXTAREA when closing an opener.'
574+
);
571575

572576
$p = new WP_HTML_Tag_Processor( 'abc</textarea>' );
573577
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </textarea> tag closer when there was no tag opener' );
574578

575579
$p = new WP_HTML_Tag_Processor( '<title>abc</title>' );
576580

577581
$p->next_tag();
578-
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </title> tag closer' );
579-
$this->assertTrue( $p->is_tag_closer(), 'Indicated a <title> tag opener is a tag closer' );
582+
$this->assertFalse(
583+
$p->next_tag( array( 'tag_closers' => 'visit' ) ),
584+
'Should not have found closing TITLE when closing an opener.'
585+
);
580586

581587
$p = new WP_HTML_Tag_Processor( 'abc</title>' );
582588
$this->assertTrue( $p->next_tag( array( 'tag_closers' => 'visit' ) ), 'Did not find the </title> tag closer when there was no tag opener' );

0 commit comments

Comments
 (0)