Ticket #19647: 19647.5.diff
File 19647.5.diff, 2.6 KB (added by , 4 years ago) |
---|
-
src/wp-includes/class-wp-admin-bar.php
35 35 /** 36 36 */ 37 37 public function initialize() { 38 $this->user = new stdClass ;38 $this->user = new stdClass(); 39 39 40 40 if ( is_user_logged_in() ) { 41 41 /* Populate settings we need for the menu based on the current user. */ … … 90 90 * @param array $node The attributes that define the node. 91 91 */ 92 92 public function add_menu( $node ) { 93 _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::add_node()' );94 93 $this->add_node( $node ); 95 94 } 96 95 … … 103 102 * @param string $id The menu slug to remove. 104 103 */ 105 104 public function remove_menu( $id ) { 106 _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::remove_node()' );107 105 $this->remove_node( $id ); 108 106 } 109 107 -
tests/phpunit/tests/adminbar.php
15 15 protected static $user_ids = array(); 16 16 17 17 public static function setUpBeforeClass() { 18 require_once ( ABSPATH . WPINC . '/class-wp-admin-bar.php' );18 require_once ABSPATH . WPINC . '/class-wp-admin-bar.php'; 19 19 20 20 parent::setUpBeforeClass(); 21 21 } … … 37 37 38 38 register_post_type( 'content', array( 'show_in_admin_bar' => true ) ); 39 39 40 $admin_bar = new WP_Admin_Bar ;40 $admin_bar = new WP_Admin_Bar(); 41 41 42 42 wp_admin_bar_new_content_menu( $admin_bar ); 43 43 … … 54 54 function test_merging_existing_meta_values() { 55 55 wp_set_current_user( self::$editor_id ); 56 56 57 $admin_bar = new WP_Admin_Bar ;57 $admin_bar = new WP_Admin_Bar(); 58 58 59 59 $admin_bar->add_node( 60 60 array( … … 346 346 } 347 347 348 348 /** 349 * @ticket 19647350 */351 public function test_deprecated_menu_methods() {352 $admin_bar = new WP_Admin_Bar();353 $node_data = array( 'id' => 'test-node-19647' );354 355 // Test add_menu() deprecation.356 $this->setExpectedDeprecated( 'WP_Admin_Bar::add_menu' );357 $admin_bar->add_menu( $node_data );358 $node_test = $admin_bar->get_node( 'test-node-19647' );359 $this->assertNotNull( $node_test );360 361 // Test remove_menu() deprecation.362 $this->setExpectedDeprecated( 'WP_Admin_Bar::remove_menu' );363 $admin_bar->remove_menu( 'test-node-19647' );364 $node_test = $admin_bar->get_node( 'test-node-19647' );365 $this->assertNull( $node_test );366 }367 368 /**369 349 * @ticket 22247 370 350 */ 371 351 public function test_admin_bar_has_edit_link_for_existing_posts() {