Changeset 60815 for trunk/tests/phpunit/tests/customize/nav-menus.php
- Timestamp:
- 09/30/2025 04:26:44 PM (6 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/customize/nav-menus.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/nav-menus.php
r60253 r60815 185 185 // Expected menu item array. 186 186 $expected = array( 187 'id' => "post-{$post_id}", 188 'title' => 'Post Title', 189 'type' => 'post_type', 190 'type_label' => 'Post', 191 'object' => 'post', 192 'object_id' => (int) $post_id, 193 'url' => get_permalink( (int) $post_id ), 187 'id' => "post-{$post_id}", 188 'title' => 'Post Title', 189 'original_title' => 'Post Title', 190 'type' => 'post_type', 191 'type_label' => 'Post', 192 'object' => 'post', 193 'object_id' => (int) $post_id, 194 'url' => get_permalink( (int) $post_id ), 194 195 ); 195 196 … … 217 218 // Expected menu item array. 218 219 $expected = array( 219 'id' => "post-{$page_id}", 220 'title' => 'Page Title', 221 'type' => 'post_type', 222 'type_label' => 'Page', 223 'object' => 'page', 224 'object_id' => (int) $page_id, 225 'url' => get_permalink( (int) $page_id ), 220 'id' => "post-{$page_id}", 221 'title' => 'Page Title', 222 'original_title' => 'Page Title', 223 'type' => 'post_type', 224 'type_label' => 'Page', 225 'object' => 'page', 226 'object_id' => (int) $page_id, 227 'url' => get_permalink( (int) $page_id ), 226 228 ); 227 229 … … 243 245 // Expected menu item array. 244 246 $expected = array( 245 'id' => "post-{$post_id}", 246 'title' => 'Post Title', 247 'type' => 'post_type', 248 'type_label' => 'Post', 249 'object' => 'post', 250 'object_id' => (int) $post_id, 251 'url' => get_permalink( (int) $post_id ), 247 'id' => "post-{$post_id}", 248 'title' => 'Post Title', 249 'original_title' => 'Post Title', 250 'type' => 'post_type', 251 'type_label' => 'Post', 252 'object' => 'post', 253 'object_id' => (int) $post_id, 254 'url' => get_permalink( (int) $post_id ), 252 255 ); 253 256 … … 269 272 // Expected menu item array. 270 273 $expected = array( 271 'id' => "term-{$term_id}", 272 'title' => 'Term Title', 273 'type' => 'taxonomy', 274 'type_label' => 'Category', 275 'object' => 'category', 276 'object_id' => (int) $term_id, 277 'url' => get_term_link( (int) $term_id, 'category' ), 274 'id' => "term-{$term_id}", 275 'title' => 'Term Title', 276 'original_title' => 'Term Title', 277 'type' => 'taxonomy', 278 'type_label' => 'Category', 279 'object' => 'category', 280 'object_id' => (int) $term_id, 281 'url' => get_term_link( (int) $term_id, 'category' ), 278 282 ); 279 283 … … 786 790 $this->assertNotEmpty( $post_types ); 787 791 788 foreach ( $post_types as $type ) {789 $this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template );790 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $type->labels->name ) . '#', $template );791 $this->assertStringContainsString( 'data-type="post_type"', $template );792 $this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template );793 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template );792 foreach ( $post_types as $type ) { 793 $this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template ); 794 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $type->labels->name ) . '#', $template ); 795 $this->assertStringContainsString( 'data-type="post_type"', $template ); 796 $this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template ); 797 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template ); 794 798 } 795 799 … … 798 802 $this->assertNotEmpty( $taxonomies ); 799 803 800 foreach ( $taxonomies as $tax ) {801 $this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template );802 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $tax->labels->name ) . '#', $template );803 $this->assertStringContainsString( 'data-type="taxonomy"', $template );804 $this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template );805 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template );804 foreach ( $taxonomies as $tax ) { 805 $this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template ); 806 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $tax->labels->name ) . '#', $template ); 807 $this->assertStringContainsString( 'data-type="taxonomy"', $template ); 808 $this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template ); 809 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template ); 806 810 } 807 811
Note: See TracChangeset
for help on using the changeset viewer.