- Timestamp:
- 03/19/2026 09:16:06 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php
r61020 r62070 136 136 137 137 /** 138 * Tests that `data-wp-bind` ignores directives with no suffix but still 139 * processes valid bind directives on the same element. 140 * 141 * @ticket 64518 142 * 143 * @covers ::process_directives 144 */ 145 public function test_wp_bind_ignores_empty_suffix_but_processes_valid_binds() { 146 $html = '<div data-wp-bind="myPlugin::state.id" data-wp-bind--id="myPlugin::state.id">Text</div>'; 147 list($p) = $this->process_directives( $html ); 148 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 149 } 150 151 /** 138 152 * Tests that `data-wp-bind` does nothing when referencing non-existent 139 153 * references. … … 417 431 $this->assertNull( $p->get_attribute( 'id---unique-id' ) ); 418 432 } 433 434 /** 435 * Tests that `data-wp-bind` ignores directives with unique IDs but still 436 * processes valid bind directives on the same element. 437 * 438 * @ticket 64518 439 * 440 * @covers ::process_directives 441 */ 442 public function test_wp_bind_ignores_unique_id_but_processes_valid_binds() { 443 $html = '<div data-wp-bind--id---unique-id="myPlugin::state.id" data-wp-bind--id="myPlugin::state.id">Text</div>'; 444 list($p) = $this->process_directives( $html ); 445 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 446 } 419 447 }
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)