mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Unit Tests:
* Automatically delete objects that we were created during `wpSetUpBeforeClass` - posts, comments, terms (except 1), and user (except 1) * The amount of leftover data between tests was breathtaking - use the new function: `_delete_all_data()` * Commit database transactions for all `TestCase`s, not just those that implement `wpSetUpBeforeClass` and `wpTearDownAfterClass` * The tests run 10-20 seconds faster now See #37699. git-svn-id: https://develop.svn.wordpress.org/trunk@38398 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,22 +35,6 @@ class Tests_User_Query extends WP_UnitTestCase {
|
||||
) );
|
||||
}
|
||||
|
||||
public static function wpTearDownAfterClass() {
|
||||
$sets = array(
|
||||
self::$author_ids,
|
||||
self::$sub_ids,
|
||||
self::$editor_ids,
|
||||
array( self::$contrib_id ),
|
||||
self::$admin_ids
|
||||
);
|
||||
|
||||
foreach ( $sets as $set ) {
|
||||
foreach ( $set as $id ) {
|
||||
self::delete_user( $id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function test_get_and_set() {
|
||||
$users = new WP_User_Query();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user