Changeset 40560 for trunk/tests/phpunit/tests/user/countUsers.php
- Timestamp:
- 04/30/2017 01:02:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/countUsers.php
r40543 r40560 170 170 ), $count['avail_roles'] ); 171 171 172 } 173 174 /** 175 * @ticket 29785 176 * 177 * @dataProvider data_count_users_strategies 178 */ 179 public function test_count_users_should_not_count_users_who_are_not_in_posts_table( $strategy ) { 180 global $wpdb; 181 182 // Get a 'before' count for comparison. 183 $count = count_users( $strategy ); 184 185 $u = self::factory()->user->create( array( 186 'role' => 'editor', 187 ) ); 188 189 // Manually delete the user, but leave the capabilities usermeta. 190 $wpdb->delete( $wpdb->users, array( 191 'ID' => $u, 192 ) ); 193 194 $count2 = count_users( $strategy ); 195 196 $this->assertEqualSets( $count, $count2 ); 172 197 } 173 198
Note: See TracChangeset
for help on using the changeset viewer.