mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Add tests to ensure the contribute Toolbar node is added when appropriate.
Follow-up to [56220]. Props costdev. See #23348. git-svn-id: https://develop.svn.wordpress.org/trunk@56227 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fc538206ec
commit
de6f51823a
@ -469,7 +469,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
* @group ms-required
|
||||
*/
|
||||
public function test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite() {
|
||||
// User is not a member of a site.
|
||||
// User is not a member of the site.
|
||||
remove_user_from_blog( self::$no_role_id, get_current_blog_id() );
|
||||
|
||||
wp_set_current_user( self::$no_role_id );
|
||||
@ -484,6 +484,61 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
$this->assertNotNull( $about_node );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the 'contribute' node is added for users with a role in single site.
|
||||
*
|
||||
* @ticket 23348
|
||||
*
|
||||
* @group ms-excluded
|
||||
*
|
||||
* @covers ::wp_admin_bar_wp_menu
|
||||
*/
|
||||
public function test_admin_bar_contains_contribute_node_for_users_with_role() {
|
||||
wp_set_current_user( self::$editor_id );
|
||||
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
|
||||
$this->assertNotNull( $wp_admin_bar->get_node( 'contribute' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the 'contribute' node is not added for users with no role in single site.
|
||||
*
|
||||
* @ticket 23348
|
||||
*
|
||||
* @group ms-excluded
|
||||
*
|
||||
* @covers ::wp_admin_bar_wp_menu
|
||||
*/
|
||||
public function test_admin_bar_does_not_contain_contribute_node_for_users_with_no_role() {
|
||||
wp_set_current_user( self::$no_role_id );
|
||||
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
|
||||
$this->assertNull( $wp_admin_bar->get_node( 'contribute' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the 'contribute' node is added for users with no role in multisite.
|
||||
*
|
||||
* @ticket 23348
|
||||
*
|
||||
* @group multisite
|
||||
* @group ms-required
|
||||
*
|
||||
* @covers ::wp_admin_bar_wp_menu
|
||||
*/
|
||||
public function test_admin_bar_contains_contribute_node_for_users_with_no_role_in_multisite() {
|
||||
// User is not a member of the site.
|
||||
remove_user_from_blog( self::$no_role_id, get_current_blog_id() );
|
||||
|
||||
wp_set_current_user( self::$no_role_id );
|
||||
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
|
||||
$this->assertNotNull( $wp_admin_bar->get_node( 'contribute' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 34113
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user