Changeset 47122 for trunk/tests/phpunit/tests/post/nav-menu.php
- Timestamp:
- 01/29/2020 12:43:23 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/nav-menu.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/nav-menu.php
r46586 r47122 84 84 ); 85 85 86 // Item without menu-item-object arg 86 // Item without menu-item-object arg. 87 87 $post_2_insert = wp_update_nav_menu_item( 88 88 $this->menu_id, … … 143 143 function test_orphan_nav_menu_item() { 144 144 145 // Create an orphan nav menu item 145 // Create an orphan nav menu item. 146 146 $custom_item_id = wp_update_nav_menu_item( 147 147 0, … … 155 155 ); 156 156 157 // Confirm it saved properly 157 // Confirm it saved properly. 158 158 $custom_item = wp_setup_nav_menu_item( get_post( $custom_item_id ) ); 159 159 $this->assertEquals( 'Wordpress.org', $custom_item->title ); 160 160 161 // Update the orphan with an associated nav menu 161 // Update the orphan with an associated nav menu. 162 162 wp_update_nav_menu_item( 163 163 $this->menu_id, … … 226 226 */ 227 227 function test_orderby_name_by_default() { 228 // We are going to create a random number of menus (min 2, max 10) 228 // We are going to create a random number of menus (min 2, max 10). 229 229 $menus_no = rand( 2, 10 ); 230 230 … … 233 233 } 234 234 235 // This is the expected array of menu names 235 // This is the expected array of menu names. 236 236 $expected_nav_menus_names = wp_list_pluck( 237 237 get_terms( … … 245 245 ); 246 246 247 // And this is what we got when calling wp_get_nav_menus() 247 // And this is what we got when calling wp_get_nav_menus(). 248 248 $nav_menus_names = wp_list_pluck( wp_get_nav_menus(), 'name' ); 249 249 … … 312 312 313 313 $this->assertEquals( $post_type_slug, $post_type_archive_item->title ); 314 $this->assertEquals( $post_type_description, $post_type_archive_item->description ); // fail!!!314 $this->assertEquals( $post_type_description, $post_type_archive_item->description ); // Fail! 315 315 } 316 316 … … 460 460 ); 461 461 462 // The markup should include whitespace between <li> s462 // The markup should include whitespace between <li>'s. 463 463 $this->assertRegExp( '/\s<li.*>|<\/li>\s/U', $menu ); 464 464 $this->assertNotRegExp( '/<\/li><li.*>/U', $menu ); 465 465 466 // White psace suppressed.466 // Whitespace suppressed. 467 467 $menu = wp_nav_menu( 468 468 array( … … 473 473 ); 474 474 475 // The markup should not include whitespace around <li> s475 // The markup should not include whitespace around <li>'s. 476 476 $this->assertNotRegExp( '/\s<li.*>|<\/li>\s/U', $menu ); 477 477 $this->assertRegExp( '/><li.*>|<\/li></U', $menu );
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)