Make WordPress Core

Ticket #19647: 19647.5.diff

File 19647.5.diff, 2.6 KB (added by whyisjake, 4 years ago)
  • src/wp-includes/class-wp-admin-bar.php

     
    3535        /**
    3636         */
    3737        public function initialize() {
    38                 $this->user = new stdClass;
     38                $this->user = new stdClass();
    3939
    4040                if ( is_user_logged_in() ) {
    4141                        /* Populate settings we need for the menu based on the current user. */
     
    9090         * @param array $node The attributes that define the node.
    9191         */
    9292        public function add_menu( $node ) {
    93                 _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::add_node()' );
    9493                $this->add_node( $node );
    9594        }
    9695
     
    103102         * @param string $id The menu slug to remove.
    104103         */
    105104        public function remove_menu( $id ) {
    106                 _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::remove_node()' );
    107105                $this->remove_node( $id );
    108106        }
    109107
  • tests/phpunit/tests/adminbar.php

     
    1515        protected static $user_ids = array();
    1616
    1717        public static function setUpBeforeClass() {
    18                 require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
     18                require_once ABSPATH . WPINC . '/class-wp-admin-bar.php';
    1919
    2020                parent::setUpBeforeClass();
    2121        }
     
    3737
    3838                register_post_type( 'content', array( 'show_in_admin_bar' => true ) );
    3939
    40                 $admin_bar = new WP_Admin_Bar;
     40                $admin_bar = new WP_Admin_Bar();
    4141
    4242                wp_admin_bar_new_content_menu( $admin_bar );
    4343
     
    5454        function test_merging_existing_meta_values() {
    5555                wp_set_current_user( self::$editor_id );
    5656
    57                 $admin_bar = new WP_Admin_Bar;
     57                $admin_bar = new WP_Admin_Bar();
    5858
    5959                $admin_bar->add_node(
    6060                        array(
     
    346346        }
    347347
    348348        /**
    349          * @ticket 19647
    350          */
    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         /**
    369349         * @ticket 22247
    370350         */
    371351        public function test_admin_bar_has_edit_link_for_existing_posts() {