Changeset 58363 for trunk/tests/phpunit/tests/html-api/wpHtmlProcessor.php
- Timestamp:
- 06/08/2024 10:55:55 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessor.php
r58192 r58363 518 518 ); 519 519 } 520 521 /** 522 * Ensures that subclasses can be created from ::create_fragment method. 523 * 524 * @ticket 61374 525 */ 526 public function test_subclass_create_fragment_creates_subclass() { 527 $processor = WP_HTML_Processor::create_fragment( '' ); 528 $this->assertInstanceOf( WP_HTML_Processor::class, $processor, '::create_fragment did not return class instance.' ); 529 530 $subclass_instance = new class('') extends WP_HTML_Processor { 531 public function __construct( $html ) { 532 parent::__construct( $html, parent::CONSTRUCTOR_UNLOCK_CODE ); 533 } 534 }; 535 536 $subclass_processor = call_user_func( array( get_class( $subclass_instance ), 'create_fragment' ), '' ); 537 $this->assertInstanceOf( get_class( $subclass_instance ), $subclass_processor, '::create_fragment did not return subclass instance.' ); 538 } 520 539 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)