From 41cfd4d8261b9265c7be29d2e438794efbe98845 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Mon, 9 May 2016 19:16:35 +0000 Subject: [PATCH] Tests: Don't create unused users in `Tests_Ajax_DeleteComment`. Fixes #36616. git-svn-id: https://develop.svn.wordpress.org/trunk@37404 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/ajax/DeleteComment.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/tests/ajax/DeleteComment.php b/tests/phpunit/tests/ajax/DeleteComment.php index 3861c38758..e8f3ae1cdd 100644 --- a/tests/phpunit/tests/ajax/DeleteComment.php +++ b/tests/phpunit/tests/ajax/DeleteComment.php @@ -21,28 +21,20 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { */ protected static $comments = array(); - protected static $admin_id = 0; - protected static $editor_id = 0; - protected static $post; + /** + * ID of a post. + * @var int + */ protected static $post_id; - protected static $user_ids = array(); public static function wpSetUpBeforeClass( $factory ) { - self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); - self::$user_ids[] = self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); - self::$post_id = $factory->post->create(); - self::$post = get_post( self::$post_id ); $comment_ids = $factory->comment->create_post_comments( self::$post_id, 8 ); self::$comments = array_map( 'get_comment', $comment_ids ); } public static function wpTearDownAfterClass() { - foreach ( self::$user_ids as $user_id ) { - self::delete_user( $user_id ); - } - wp_delete_post( self::$post_id, true ); foreach ( self::$comments as $c ) {