Skip to content

Commit

Permalink
Add additional test for child selection
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Dec 10, 2022
1 parent 6517caf commit 3bc443e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions phpunit/html/wp-html-processor-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public function test_find_immediate_child_tag() {
$this->assertFalse( $tags->next_within_balanced_tags( 'img', 1 ) );
}

public function test_find_immediate_child_tag2() {
$tags = new WP_HTML_Processor( '<div><div><div><img></div></div><img></div>' );

$tags->next_tag( 'div' );
$this->assertTrue( $tags->next_within_balanced_tags( 'img', 1 ) );
}

public function test_find_child_tag() {
$tags = new WP_HTML_Processor( '<div><div><div><img></div></div></div>' );

Expand Down

0 comments on commit 3bc443e

Please sign in to comment.