Skip to content

Commit

Permalink
Test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jan 18, 2024
1 parent c28ea1d commit 2a80cd2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public function test_in_body_any_other_end_tag_with_unclosed_non_special_element
}

/**
* Verifies that when "in body" and encountering a br close tag `</br …>`:
* Verifies that when "in body" and encountering a BR end tag `</br …>`:
*
* > An end tag whose tag name is "br"
* > Parse error. Drop the attributes from the token, and act as described in the next entry;
Expand All @@ -391,15 +391,14 @@ public function test_in_body_any_other_end_tag_with_unclosed_non_special_element
*
* @since 6.4.0
*/
public function test_br_close_tag_special_behavior() {
public function test_br_end_tag_special_behavior() {
$this->markTestIncomplete( 'BR end tag special handling is unimplemented' );

$p = WP_HTML_Processor::create_fragment( '</br attribute="must be removed">' );

$this->assertTrue( $p->next_tag( 'BR' ), 'No BR tag found.' );
$this->assertTrue( $p->next_tag(), 'No BR tag found.' );
$this->assertFalse( $p->is_tag_closer(), '</br> should not be treated as an end tag.' );
$this->assertNull( $p->get_attribute_names_with_prefix( '' ), 'BR end tag had attributes.' );
$this->assertFalse( $p->is_tag_closer(), '</br> is treated as a BR start tag.' );

$this->assertFalse( $p->set_attribute( 'new-attribute', 'added' ), 'BR end tag becomes an opener' );
$this->assertCount( 1, $p->get_attribute_names_with_prefix( '' ), 'Tag should have 1 attribute.' );
$this->assertSame( 'added', $p->get_attribute( 'new-attribute' ), 'Tag did not set attribute value correctly.' );
Expand Down

0 comments on commit 2a80cd2

Please sign in to comment.