- Timestamp:
- 08/08/2024 07:23:53 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php
r58836 r58867 166 166 167 167 /** 168 * Ensures that no new HTML elements are accidentally partially-supported.169 *170 * When introducing support for new HTML elements, there are multiple places171 * in the HTML Processor that need to be updated, until the time that the class172 * has full HTML5 support. Because of this, these tests lock down the interface173 * to ensure that support isn't accidentally updated in one place for a new174 * element while overlooked in another.175 *176 * @ticket 58517177 *178 * @covers WP_HTML_Processor::step179 *180 * @dataProvider data_unsupported_elements181 *182 * @param string $html HTML string containing unsupported elements.183 */184 public function test_fails_when_encountering_unsupported_tag( $html ) {185 $processor = WP_HTML_Processor::create_fragment( $html );186 187 $this->assertFalse( $processor->step(), "Should not have stepped into unsupported {$processor->get_tag()} element." );188 }189 190 /**191 * Data provider.192 *193 * @return array[]194 */195 public static function data_unsupported_elements() {196 $unsupported_elements = array(197 'MATH',198 'PLAINTEXT', // Neutralized.199 'SVG',200 );201 202 $data = array();203 foreach ( $unsupported_elements as $tag_name ) {204 $data[ $tag_name ] = array( "<{$tag_name}>" );205 }206 207 return $data;208 }209 210 /**211 168 * @ticket 58517 212 169 *
Note: See TracChangeset
for help on using the changeset viewer.