From 6c674cfe20d9e5daf19fcd3065c780640cef8c48 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 14 Oct 2015 14:38:30 +0000 Subject: [PATCH] Create fewer fixtures in XML-RPC `getComments` tests. See #30017, #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@35154 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/xmlrpc/wp/getComments.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/tests/xmlrpc/wp/getComments.php b/tests/phpunit/tests/xmlrpc/wp/getComments.php index bda7ed0271..a91b95a9f4 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getComments.php +++ b/tests/phpunit/tests/xmlrpc/wp/getComments.php @@ -6,13 +6,6 @@ class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { var $post_id; - function setUp() { - parent::setUp(); - - $this->post_id = $this->factory->post->create(); - $this->factory->comment->create_post_comments( $this->post_id, 15 ); - } - function test_invalid_username_password() { $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) ); $this->assertInstanceOf( 'IXR_Error', $result ); @@ -28,6 +21,9 @@ class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { } function test_capable_user() { + $this->post_id = $this->factory->post->create(); + $this->factory->comment->create_post_comments( $this->post_id, 2 ); + $this->make_user_by_role( 'editor' ); $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array() ) ); @@ -40,6 +36,9 @@ class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { } function test_post_filter() { + $this->post_id = $this->factory->post->create(); + $this->factory->comment->create_post_comments( $this->post_id, 2 ); + $this->make_user_by_role( 'editor' ); $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array( @@ -53,6 +52,9 @@ class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { } function test_number_filter() { + $this->post_id = $this->factory->post->create(); + $this->factory->comment->create_post_comments( $this->post_id, 11 ); + $this->make_user_by_role( 'editor' ); $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array( @@ -205,4 +207,4 @@ class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { $this->assertInternalType( 'array', $result2 ); $this->assertCount( 1, $result2 ); } -} \ No newline at end of file +}