Skip to content

Commit

Permalink
Small details.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Feb 15, 2024
1 parent 2c4053f commit 54c9301
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php
Expand Up @@ -308,7 +308,11 @@ public function test_updates_bookmark_for_additions_after_both_sides() {
$processor->seek( 'first' );
$processor->add_class( 'first' );

$this->assertSame( 'one', $processor->get_attribute( 'id' ) );
$this->assertSame(
'one',
$processor->get_attribute( 'id' ),
'Should have remembered attribute change from before the seek.'
);

$this->assertSame(
'<div class="first" id="one">First</div><div class="second" id="two">Second</div>',
Expand Down
6 changes: 4 additions & 2 deletions tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
Expand Up @@ -2759,15 +2759,17 @@ public function insert_after( $new_html ) {
$subclass->next_tag();
$this->assertSame(
'P',
$subclass->get_tag()
$subclass->get_tag(),
'Should have matched inserted HTML as next tag.'
);

$subclass->next_tag( 'img' );
$subclass->set_attribute( 'alt', 'mountain' );

$this->assertSame(
'<div><img><p>snow-capped</p></div><div><img alt="mountain"></div>',
$subclass->get_updated_html()
$subclass->get_updated_html(),
'Should have properly applied the update from in front of the cursor.'
);
}
}

0 comments on commit 54c9301

Please sign in to comment.