Changeset 47122 for trunk/tests/phpunit/tests/adminbar.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/adminbar.php
r46678 r47122 100 100 $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' ); 101 101 102 // Site menu points to the home page instead of the admin URL 102 // Site menu points to the home page instead of the admin URL. 103 103 $this->assertEquals( home_url( '/' ), $node_site_name->href ); 104 104 105 // No profile links as the user doesn't have any permissions on the site 105 // No profile links as the user doesn't have any permissions on the site. 106 106 $this->assertFalse( $node_my_account->href ); 107 107 $this->assertFalse( $node_user_info->href ); … … 125 125 $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' ); 126 126 127 // Site menu points to the admin URL 127 // Site menu points to the admin URL. 128 128 $this->assertEquals( admin_url( '/' ), $node_site_name->href ); 129 129 130 130 $profile_url = admin_url( 'profile.php' ); 131 131 132 // Profile URLs point to profile.php 132 // Profile URLs point to profile.php. 133 133 $this->assertEquals( $profile_url, $node_my_account->href ); 134 134 $this->assertEquals( $profile_url, $node_user_info->href ); … … 165 165 $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' ); 166 166 167 // get primary blog167 // Get primary blog. 168 168 $primary = get_active_blog_for_user( self::$editor_id ); 169 169 $this->assertInternalType( 'object', $primary ); 170 170 171 // No Site menu as the user isn't a member of this blog 171 // No Site menu as the user isn't a member of this blog. 172 172 $this->assertNull( $node_site_name ); 173 173 174 174 $primary_profile_url = get_admin_url( $primary->blog_id, 'profile.php' ); 175 175 176 // Ensure the user's primary blog is not the same as the main site 176 // Ensure the user's primary blog is not the same as the main site. 177 177 $this->assertNotEquals( $primary_profile_url, admin_url( 'profile.php' ) ); 178 178 179 // Profile URLs should go to the user's primary blog 179 // Profile URLs should go to the user's primary blog. 180 180 $this->assertEquals( $primary_profile_url, $node_my_account->href ); 181 181 $this->assertEquals( $primary_profile_url, $node_user_info->href ); … … 204 204 $this->assertTrue( is_user_member_of_blog( self::$no_role_id, get_current_blog_id() ) ); 205 205 206 // Remove `$nobody` from the current blog, so they're not a member of any blog 206 // Remove `$nobody` from the current blog, so they're not a member of any blog. 207 207 $removed = remove_user_from_blog( self::$no_role_id, get_current_blog_id() ); 208 208 … … 221 221 $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' ); 222 222 223 // get primary blog223 // Get primary blog. 224 224 $primary = get_active_blog_for_user( self::$no_role_id ); 225 225 $this->assertNull( $primary ); 226 226 227 // No Site menu as the user isn't a member of this site 227 // No Site menu as the user isn't a member of this site. 228 228 $this->assertNull( $node_site_name ); 229 229 … … 232 232 $this->assertNotEquals( $user_profile_url, admin_url( 'profile.php' ) ); 233 233 234 // Profile URLs should go to the user's primary blog 234 // Profile URLs should go to the user's primary blog. 235 235 $this->assertEquals( $user_profile_url, $node_my_account->href ); 236 236 $this->assertEquals( $user_profile_url, $node_user_info->href ); … … 336 336 ), 337 337 array( 338 // Boolean, false 338 // Boolean, false. 339 339 array( 340 340 'id' => 'test-node',
Note: See TracChangeset
for help on using the changeset viewer.