Make WordPress Core


Ignore:
Timestamp:
09/27/2016 07:00:35 PM (10 years ago)
Author:
ocean90
Message:

Toolbar: Update links to the about page if current user can't access the dashboard of the current site.

Add missing focus styling for menu items with an icon.

Fixes #37949.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/adminbar.php

    r38634 r38660  
    408408        $this->assertNull( $node );
    409409    }
     410
     411    /**
     412     * @ticket 37949
     413     */
     414    public function test_admin_bar_does_not_add_about_page_url() {
     415        wp_set_current_user( self::$no_role_id );
     416
     417        $wp_admin_bar = $this->get_standard_admin_bar();
     418        $node         = $wp_admin_bar->get_node( 'wp-logo' );
     419
     420        $this->assertNotNull( $node );
     421        $this->assertSame( false, $node->href );
     422        $this->assertArrayHasKey( 'tabindex', $node->meta );
     423        $this->assertSame( 0, $node->meta['tabindex'] );
     424
     425        wp_set_current_user( self::$editor_id );
     426
     427        $wp_admin_bar = $this->get_standard_admin_bar();
     428        $node         = $wp_admin_bar->get_node( 'wp-logo' );
     429
     430        $this->assertNotNull( $node );
     431        $this->assertSame( admin_url( 'about.php' ), $node->href );
     432        $this->assertArrayNotHasKey( 'tabindex', $node->meta );
     433    }
    410434}
Note: See TracChangeset for help on using the changeset viewer.