diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php index d37007d824..2af822f456 100644 --- a/tests/phpunit/tests/comment.php +++ b/tests/phpunit/tests/comment.php @@ -121,14 +121,14 @@ class Tests_Comment extends WP_UnitTestCase { ) ); + wp_set_current_user( 0 ); + $comment = get_comment( $comment_id ); $expected_content = is_multisite() ? 'new comment ' : 'new comment '; $this->assertSame( $expected_content, $comment->comment_content ); - - wp_set_current_user( 0 ); } public function test_update_comment_from_unprivileged_user_by_privileged_user() { @@ -165,9 +165,10 @@ class Tests_Comment extends WP_UnitTestCase { ) ); + wp_set_current_user( 0 ); + $comment = get_comment( $comment_id ); $this->assertSame( 'click', $comment->comment_content, 'Comment: ' . $comment->comment_content ); - wp_set_current_user( 0 ); } /**