- Timestamp:
- 10/21/2025 12:07:16 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-text.php
r58594 r61020 13 13 * @group interactivity-api 14 14 */ 15 class Tests_ Interactivity_API_WpInteractivityAPIWPText extends WP_UnitTestCase {15 class Tests_WP_Interactivity_API_WP_Text extends WP_UnitTestCase { 16 16 /** 17 17 * Instance of WP_Interactivity_API. … … 132 132 * 133 133 * @covers ::process_directives 134 *135 * @expectedIncorrectUsage WP_Interactivity_API::_process_directives136 134 */ 137 135 public function test_wp_text_fails_with_unbalanced_and_same_tags_inside_content() { … … 155 153 $this->assertSame( '<div data-wp-text="myPlugin::state.text"><span>Updated</span></div>', $new_html ); 156 154 } 155 156 /** 157 * Tests it ignores suffixes and unique-ids. 158 * 159 * @ticket 64106 160 * 161 * @covers ::process_directives 162 */ 163 public function test_wp_text_ignores_suffixes_and_unique_ids() { 164 $html = '<span data-wp-text--suffix="myPlugin::state.text">Text</span>'; 165 $new_html = $this->interactivity->process_directives( $html ); 166 $this->assertSame( $html, $new_html ); 167 168 $html = '<span data-wp-text---unique-id="myPlugin::state.text">Text</span>'; 169 $new_html = $this->interactivity->process_directives( $html ); 170 $this->assertSame( $html, $new_html ); 171 } 172 173 /** 174 * Tests first `data-wp-text` works even when suffixes and unique-ids are included. 175 * 176 * @ticket 64106 177 * 178 * @covers ::process_directives 179 */ 180 public function test_wp_text_works_even_when_suffixes_and_unique_ids_are_included() { 181 $original = '<span data-wp-text--suffix="myPlugin::state.text" data-wp-text---unique-id="myPlugin::state.text" data-wp-text="myPlugin::state.text">Text</span>'; 182 $expected = '<span data-wp-text--suffix="myPlugin::state.text" data-wp-text---unique-id="myPlugin::state.text" data-wp-text="myPlugin::state.text">Updated</span>'; 183 $new_html = $this->interactivity->process_directives( $original ); 184 $this->assertSame( $expected, $new_html ); 185 } 157 186 }
Note: See TracChangeset
for help on using the changeset viewer.