Changeset 62070
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r61885 r62070 1027 1027 foreach ( $entries as $entry ) { 1028 1028 if ( empty( $entry['suffix'] ) || null !== $entry['unique_id'] ) { 1029 return;1029 continue; 1030 1030 } 1031 1031 -
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.