- Timestamp:
- 07/22/2024 10:22:03 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorSemanticRules.php
r58713 r58779 407 407 408 408 /** 409 * Ensures that support isn't accidentally partially added for the closing BR tag `</br>`. 410 * 411 * This tag closer has special rules and support shouldn't be added without implementing full support. 409 * Ensures that closing `</br>` tags are appropriately treated as opening tags with no attributes. 412 410 * 413 411 * > An end tag whose tag name is "br" … … 416 414 * > tag token that it actually is. 417 415 * 418 * When this handling is implemented, this test should be removed. It's not incorporated419 * into the existing unsupported tag behavior test because the opening tag is supported;420 * only the closing tag isn't.421 *422 416 * @covers WP_HTML_Processor::step_in_body 423 417 * … … 425 419 */ 426 420 public function test_br_end_tag_unsupported() { 427 $processor = WP_HTML_Processor::create_fragment( '</br>' ); 428 429 $this->assertFalse( $processor->next_tag(), 'Found a BR tag that should not be handled.' ); 430 $this->assertSame( WP_HTML_Processor::ERROR_UNSUPPORTED, $processor->get_last_error() ); 421 $processor = WP_HTML_Processor::create_fragment( '</br id="an-opener" html>' ); 422 423 $this->assertTrue( $processor->next_tag(), 'Failed to find the expected opening BR tag.' ); 424 $this->assertFalse( $processor->is_tag_closer(), 'Should have treated the tag as an opening tag.' ); 425 $this->assertNull( $processor->get_attribute_names_with_prefix( '' ), 'Should have ignored any attributes on the tag.' ); 431 426 } 432 427 }
Note: See TracChangeset
for help on using the changeset viewer.