- Timestamp:
- 10/05/2023 10:40:48 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php
r56702 r56790 24 24 */ 25 25 public function test_navigates_into_normative_html_for_supported_elements( $html, $tag_name ) { 26 $p = WP_HTML_Processor::create Fragment( $html );26 $p = WP_HTML_Processor::create_fragment( $html ); 27 27 28 28 $this->assertTrue( $p->step(), "Failed to step into supported {$tag_name} element." ); … … 86 86 */ 87 87 public function test_fails_when_encountering_unsupported_tag( $html ) { 88 $p = WP_HTML_Processor::create Fragment( $html );88 $p = WP_HTML_Processor::create_fragment( $html ); 89 89 90 90 $this->assertFalse( $p->step(), "Should not have stepped into unsupported {$p->get_tag()} element." ); … … 237 237 */ 238 238 public function test_fails_when_encountering_unsupported_markup( $html, $description ) { 239 $p = WP_HTML_Processor::create Fragment( $html );239 $p = WP_HTML_Processor::create_fragment( $html ); 240 240 241 241 while ( $p->step() && null === $p->get_attribute( 'supported' ) ) { … … 278 278 */ 279 279 public function test_finds_correct_tag_given_breadcrumbs( $html, $breadcrumbs, $n ) { 280 $p = WP_HTML_Processor::create Fragment( $html );280 $p = WP_HTML_Processor::create_fragment( $html ); 281 281 282 282 $p->next_tag( … … 304 304 */ 305 305 public function test_reports_correct_breadcrumbs_for_html( $html, $breadcrumbs, $ignored_n ) { 306 $p = WP_HTML_Processor::create Fragment( $html );306 $p = WP_HTML_Processor::create_fragment( $html ); 307 307 308 308 while ( $p->next_tag() && null === $p->get_attribute( 'target' ) ) { … … 363 363 */ 364 364 public function test_reports_if_tag_matches_breadcrumbs_of_various_specificity( $html_with_target_node, $breadcrumbs, $should_match ) { 365 $processor = WP_HTML_Processor::create Fragment( $html_with_target_node );365 $processor = WP_HTML_Processor::create_fragment( $html_with_target_node ); 366 366 while ( $processor->next_tag() && null === $processor->get_attribute( 'target' ) ) { 367 367 continue; … … 421 421 */ 422 422 public function test_can_modify_attributes_after_finding_tag() { 423 $p = WP_HTML_Processor::create Fragment( '<div><figure><img><figcaption>test</figcaption></figure>' );423 $p = WP_HTML_Processor::create_fragment( '<div><figure><img><figcaption>test</figcaption></figure>' ); 424 424 425 425 $this->assertTrue( $p->next_tag( array( 'breadcrumbs' => array( 'figcaption' ) ) ), 'Unable to find given tag.' ); … … 439 439 */ 440 440 public function test_can_query_an_element_by_tag_name() { 441 $p = WP_HTML_Processor::create Fragment( '<div><DIV><strong><img></strong></DIV>' );441 $p = WP_HTML_Processor::create_fragment( '<div><DIV><strong><img></strong></DIV>' ); 442 442 $p->next_tag( 'IMG' ); 443 443 $p->set_attribute( 'loading', 'lazy' ); … … 456 456 */ 457 457 public function test_can_seek_back_and_forth() { 458 $p = WP_HTML_Processor::create Fragment( '<div><p one><div><p><div two><p><div><p><div><p three>' );458 $p = WP_HTML_Processor::create_fragment( '<div><p one><div><p><div two><p><div><p><div><p three>' ); 459 459 460 460 // Find first tag of interest.
Note: See TracChangeset
for help on using the changeset viewer.