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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2016-09-27 19:00:35 +00:00
parent 8fcec07595
commit 0bab64c370
4 changed files with 50 additions and 7 deletions

View File

@@ -407,4 +407,28 @@ class Tests_AdminBar extends WP_UnitTestCase {
$this->assertNull( $node );
}
/**
* @ticket 37949
*/
public function test_admin_bar_does_not_add_about_page_url() {
wp_set_current_user( self::$no_role_id );
$wp_admin_bar = $this->get_standard_admin_bar();
$node = $wp_admin_bar->get_node( 'wp-logo' );
$this->assertNotNull( $node );
$this->assertSame( false, $node->href );
$this->assertArrayHasKey( 'tabindex', $node->meta );
$this->assertSame( 0, $node->meta['tabindex'] );
wp_set_current_user( self::$editor_id );
$wp_admin_bar = $this->get_standard_admin_bar();
$node = $wp_admin_bar->get_node( 'wp-logo' );
$this->assertNotNull( $node );
$this->assertSame( admin_url( 'about.php' ), $node->href );
$this->assertArrayNotHasKey( 'tabindex', $node->meta );
}
}