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
This commit is contained in:
Boone Gorges 2015-10-14 14:38:30 +00:00
parent ad519f2ee0
commit 6c674cfe20
1 changed files with 10 additions and 8 deletions

View File

@ -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 );
}
}
}