Skip to content

Commit 2a80cd2

Browse files
committed
Test tweaks
1 parent c28ea1d commit 2a80cd2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public function test_in_body_any_other_end_tag_with_unclosed_non_special_element
378378
}
379379

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

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

399-
$this->assertTrue( $p->next_tag( 'BR' ), 'No BR tag found.' );
399+
$this->assertTrue( $p->next_tag(), 'No BR tag found.' );
400+
$this->assertFalse( $p->is_tag_closer(), '</br> should not be treated as an end tag.' );
400401
$this->assertNull( $p->get_attribute_names_with_prefix( '' ), 'BR end tag had attributes.' );
401-
$this->assertFalse( $p->is_tag_closer(), '</br> is treated as a BR start tag.' );
402-
403402
$this->assertFalse( $p->set_attribute( 'new-attribute', 'added' ), 'BR end tag becomes an opener' );
404403
$this->assertCount( 1, $p->get_attribute_names_with_prefix( '' ), 'Tag should have 1 attribute.' );
405404
$this->assertSame( 'added', $p->get_attribute( 'new-attribute' ), 'Tag did not set attribute value correctly.' );

0 commit comments

Comments
 (0)