- Timestamp:
- 09/30/2025 05:05:21 PM (11 months ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/customize/nav-menus.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/trunk merged: 60814-60816
- Property svn:mergeinfo changed
-
branches/5.2/tests/phpunit/tests/customize/nav-menus.php
r43571 r60834 145 145 // Home is included in menu items when page is zero. 146 146 $items = $menus->load_available_items_query( 'post_type', 'page', 0 ); 147 $this->assertContains( $expected, $items );147 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 148 148 149 149 // Home is not included in menu items when page is larger than zero. 150 150 $items = $menus->load_available_items_query( 'post_type', 'page', 1 ); 151 151 $this->assertNotEmpty( $items ); 152 $this->assertNotContains( $expected, $items );152 $this->assertNotContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 153 153 } 154 154 … … 162 162 163 163 // Create page. 164 $post_id = self::factory()->post->create( array( 'post_title' => 'Post Title' ) );164 $post_id = self::factory()->post->create( array( 'post_title' => 'Post <strong>Strong</strong> Title' ) ); 165 165 166 166 // Create pages. … … 169 169 // Expected menu item array. 170 170 $expected = array( 171 'id' => "post-{$post_id}", 172 'title' => 'Post Title', 173 'type' => 'post_type', 174 'type_label' => 'Post', 175 'object' => 'post', 176 'object_id' => intval( $post_id ), 177 'url' => get_permalink( intval( $post_id ) ), 171 'id' => "post-{$post_id}", 172 'title' => 'Post <strong>Strong</strong> Title', 173 'original_title' => 'Post <strong>Strong</strong> Title', 174 'type' => 'post_type', 175 'type_label' => 'Post', 176 'object' => 'post', 177 'object_id' => (int) $post_id, 178 'url' => get_permalink( (int) $post_id ), 178 179 ); 179 180 180 181 // Offset the query and get the second page of menu items. 181 182 $items = $menus->load_available_items_query( 'post_type', 'post', 1 ); 182 $this->assertContains( $expected, $items );183 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 183 184 } 184 185 … … 201 202 // Expected menu item array. 202 203 $expected = array( 203 'id' => "post-{$page_id}", 204 'title' => 'Page Title', 205 'type' => 'post_type', 206 'type_label' => 'Page', 207 'object' => 'page', 208 'object_id' => intval( $page_id ), 209 'url' => get_permalink( intval( $page_id ) ), 204 'id' => "post-{$page_id}", 205 'title' => 'Page Title', 206 'original_title' => 'Page Title', 207 'type' => 'post_type', 208 'type_label' => 'Page', 209 'object' => 'page', 210 'object_id' => (int) $page_id, 211 'url' => get_permalink( (int) $page_id ), 210 212 ); 211 213 212 214 $items = $menus->load_available_items_query( 'post_type', 'page', 0 ); 213 $this->assertContains( $expected, $items );215 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 214 216 } 215 217 … … 227 229 // Expected menu item array. 228 230 $expected = array( 229 'id' => "post-{$post_id}", 230 'title' => 'Post Title', 231 'type' => 'post_type', 232 'type_label' => 'Post', 233 'object' => 'post', 234 'object_id' => intval( $post_id ), 235 'url' => get_permalink( intval( $post_id ) ), 231 'id' => "post-{$post_id}", 232 'title' => 'Post Title', 233 'original_title' => 'Post Title', 234 'type' => 'post_type', 235 'type_label' => 'Post', 236 'object' => 'post', 237 'object_id' => (int) $post_id, 238 'url' => get_permalink( (int) $post_id ), 236 239 ); 237 240 238 241 $items = $menus->load_available_items_query( 'post_type', 'post', 0 ); 239 $this->assertContains( $expected, $items );242 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 240 243 } 241 244 … … 253 256 // Expected menu item array. 254 257 $expected = array( 255 'id' => "term-{$term_id}", 256 'title' => 'Term Title', 257 'type' => 'taxonomy', 258 'type_label' => 'Category', 259 'object' => 'category', 260 'object_id' => intval( $term_id ), 261 'url' => get_term_link( intval( $term_id ), 'category' ), 258 'id' => "term-{$term_id}", 259 'title' => 'Term Title', 260 'original_title' => 'Term Title', 261 'type' => 'taxonomy', 262 'type_label' => 'Category', 263 'object' => 'category', 264 'object_id' => (int) $term_id, 265 'url' => get_term_link( (int) $term_id, 'category' ), 262 266 ); 263 267 264 268 $items = $menus->load_available_items_query( 'taxonomy', 'category', 0 ); 265 $this->assertContains( $expected, $items );269 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 266 270 } 267 271 … … 288 292 289 293 $items = $menus->load_available_items_query( 'custom_type', 'custom_object', 0 ); 290 $this->assertContains( $expected, $items );294 $this->assertContains( $expected, $items, "Items:\n" . var_export( $items, true ) ); 291 295 } 292 296
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)