Skip to content

Commit

Permalink
Test set_content_inside_balanced_tags preceded by set_attribute works
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Jan 12, 2023
1 parent e3f89fd commit a989f71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions phpunit/html/wp-html-processor-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,13 @@ public function test_set_content_inside_balanced_tags_followed_by_set_attribute_
$tags->set_attribute( 'id', 'thesection' );
$this->assertSame( '<div>outside</div><section id="thesection">This is the new section content.</section>', $tags->get_updated_html() );
}

public function test_set_content_inside_balanced_tags_preceded_by_set_attribute_works() {
$tags = new WP_HTML_Processor( self::HTML );

$tags->next_tag( 'section' );
$tags->set_attribute( 'id', 'thesection' );
$tags->set_content_inside_balanced_tags( 'This is the new section content.' );
$this->assertSame( '<div>outside</div><section id="thesection">This is the new section content.</section>', $tags->get_updated_html() );
}
}

0 comments on commit a989f71

Please sign in to comment.