Changeset 51462 for trunk/tests/phpunit/tests/customize/nav-menus.php
- Timestamp:
- 07/19/2021 02:00:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/nav-menus.php
r51331 r51462 746 746 ); 747 747 748 $this->assert Contains( $expected, $template );748 $this->assertStringContainsString( $expected, $template ); 749 749 } 750 750 … … 765 765 $expected = sprintf( 'Customizing ▸ %s', esc_html( $this->wp_customize->get_panel( 'nav_menus' )->title ) ); 766 766 767 $this->assert Contains( $expected, $template );767 $this->assertStringContainsString( $expected, $template ); 768 768 769 769 $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); 770 770 if ( $post_types ) { 771 771 foreach ( $post_types as $type ) { 772 $this->assert Contains( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template );772 $this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template ); 773 773 $this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $type->labels->name ) . '#', $template ); 774 $this->assert Contains( 'data-type="post_type"', $template );775 $this->assert Contains( 'data-object="' . esc_attr( $type->name ) . '"', $template );776 $this->assert Contains( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template );774 $this->assertStringContainsString( 'data-type="post_type"', $template ); 775 $this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template ); 776 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template ); 777 777 } 778 778 } … … 781 781 if ( $taxonomies ) { 782 782 foreach ( $taxonomies as $tax ) { 783 $this->assert Contains( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template );783 $this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template ); 784 784 $this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $tax->labels->name ) . '#', $template ); 785 $this->assert Contains( 'data-type="taxonomy"', $template );786 $this->assert Contains( 'data-object="' . esc_attr( $tax->name ) . '"', $template );787 $this->assert Contains( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template );785 $this->assertStringContainsString( 'data-type="taxonomy"', $template ); 786 $this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template ); 787 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template ); 788 788 } 789 789 } 790 790 791 $this->assert Contains( 'available-menu-items-custom_type', $template );791 $this->assertStringContainsString( 'available-menu-items-custom_type', $template ); 792 792 $this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*Custom#', $template ); 793 $this->assert Contains( 'data-type="custom_type"', $template );794 $this->assert Contains( 'data-object="custom_object"', $template );795 $this->assert Contains( 'data-type_label="Custom Type"', $template );793 $this->assertStringContainsString( 'data-type="custom_type"', $template ); 794 $this->assertStringContainsString( 'data-object="custom_object"', $template ); 795 $this->assertStringContainsString( 'data-type_label="Custom Type"', $template ); 796 796 } 797 797 … … 1141 1141 $result = $menus->filter_wp_nav_menu( $nav_menu_content, (object) $args ); 1142 1142 1143 $this->assert Contains( sprintf( ' data-customize-partial-id="nav_menu_instance[%s]"', $args['customize_preview_nav_menus_args']['args_hmac'] ), $result );1144 $this->assert Contains( ' data-customize-partial-type="nav_menu_instance"', $result );1143 $this->assertStringContainsString( sprintf( ' data-customize-partial-id="nav_menu_instance[%s]"', $args['customize_preview_nav_menus_args']['args_hmac'] ), $result ); 1144 $this->assertStringContainsString( ' data-customize-partial-type="nav_menu_instance"', $result ); 1145 1145 $this->assertTrue( (bool) preg_match( '/data-customize-partial-placement-context="(.+?)"/', $result, $matches ) ); 1146 1146 $context = json_decode( html_entity_decode( $matches[1] ), true ); … … 1226 1226 1227 1227 $rendered = $partial->render( $nav_menu_args['customize_preview_nav_menus_args'] ); 1228 $this->assert Contains( 'data-customize-partial-type="nav_menu_instance"', $rendered );1229 $this->assert Contains( 'WordPress.org', $rendered );1228 $this->assertStringContainsString( 'data-customize-partial-type="nav_menu_instance"', $rendered ); 1229 $this->assertStringContainsString( 'WordPress.org', $rendered ); 1230 1230 } 1231 1231 }
Note: See TracChangeset
for help on using the changeset viewer.