Changeset 58854 for trunk/tests/phpunit/tests/post/nav-menu.php
- Timestamp:
- 08/05/2024 06:58:49 PM (20 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/nav-menu.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/nav-menu.php
r57987 r58854 1210 1210 1211 1211 /** 1212 * Tests `wp_update_nav_menu_item()` with a non-existing taxonomy. 1213 * 1214 * When inserting a term from a non-existing taxonomy as a nav item, 1215 * the `post_title` property should be empty, and the function 1216 * should not throw a fatal error for `wp_specialchars_decode()`. 1217 * 1218 * @ticket 61799 1219 */ 1220 public function test_wp_update_nav_menu_item_with_invalid_taxonomy() { 1221 register_taxonomy( 'invalid', 'post' ); 1222 $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'invalid' ) ); 1223 unregister_taxonomy( 'invalid' ); 1224 1225 $menu_item_id = wp_update_nav_menu_item( 1226 $this->menu_id, 1227 0, 1228 array( 1229 'menu-item-type' => 'taxonomy', 1230 'menu-item-object' => 'invalid', 1231 'menu-item-object-id' => $term->term_id, 1232 'menu-item-status' => 'publish', 1233 ) 1234 ); 1235 1236 $menu_item = get_post( $menu_item_id ); 1237 $this->assertEmpty( $menu_item->post_title ); 1238 } 1239 1240 /** 1212 1241 * Test passed post_date/post_date_gmt. 1213 1242 *
Note: See TracChangeset
for help on using the changeset viewer.