wordpress-develop/tests/phpunit/tests/user
Jonny Harris e19b7ead2c Users: Introduce the concept of a large site to single site installations.
Currently in WordPress multisite there is a concept of large networks. The function `wp_is_large_network` is used to determine if a network has a large number of sites or users. If a network is marked as large, then 
expensive queries to calculate user counts are not run on page load but deferred to scheduled events. However there are a number of places in a single site installation where this functionality would also be useful, as 
expensive calls to count users and roles can make screens in the admin extremely slow.

In this change, the `get_user_count` function and related functionality around it is ported to be available in a single site context. This means that expensive calls to the `count_users` function are replaced with 
calls to `get_user_count`. This change also includes a new function called `wp_is_large_user_count` and a filter of the same name, to mark if a site is large.

Props johnbillion, Spacedmonkey, Mista-Flo, lumpysimon, tharsheblows, obenland, miss_jwo, jrchamp, flixos90, macbookandrew, pento, desrosj, johnjamesjacoby, jb510, davidbaumwald, costdev. 
Fixes #38741.



git-svn-id: https://develop.svn.wordpress.org/trunk@53011 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 12:41:00 +00:00
..
author.php Build/Test Tools: Reduce the use of unnecessary randomness in tests. 2021-12-19 13:42:37 +00:00
capabilities.php Tests: Restore the original user role in the (add|remove)_user_role hooks test. 2022-03-06 23:02:12 +00:00
countUserPosts.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
countUsers.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
dateQuery.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
getActiveBlogForUser.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
getUserCount.php Users: Introduce the concept of a large site to single site installations. 2022-03-29 12:41:00 +00:00
listAuthors.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
mapMetaCap.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
multisite.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
query.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
retrievePassword.php Docs: Further update the send_retrieve_password_email filter documentation for consistency. 2022-01-19 13:16:44 +00:00
session.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
slashes.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
updateUserCaches.php Tests: Use assertInstanceOf() instead of assertTrue() in some tests. 2021-05-18 21:04:31 +00:00
wpAuthenticateSpamCheck.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
wpDeleteUser.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
wpDropdownUsers.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
wpGetUsersWithNoRole.php General: Replace older-style PHP type conversion functions with type casts. 2020-10-08 21:13:57 +00:00
wpListUsers.php Users: Introduce wp_list_users() function. 2021-11-09 00:22:34 +00:00
wpSendUserRequest.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
wpSetCurrentUser.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00