WordPress.org

Make WordPress Core

Changeset 1137 in tests


Ignore:
Timestamp:
11/14/12 22:52:12 (18 months ago)
Author:
westi
Message:

XMLRPC: Fix up the new test from [1133] so that it correctly tests the bug.

Previously the test created a post that the test user couldn't edit and so the Post Editing failed.

See #WP22220

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/xmlrpc/wp/editPost.php

    r1133 r1137  
    295295        $editor_id = $this->make_user_by_role( 'editor' ); 
    296296 
    297         $post_id = $this->factory->post->create(); 
     297        $post_id = $this->factory->post->create( array( 'post_author'  => $editor_id ) ); 
    298298        $term_id = $this->factory->category->create(); 
    299299        $this->factory->term->add_post_terms( $post_id, $term_id, 'category', true ); 
     
    301301        $this->assertContains( $term_id, $term_ids ); 
    302302 
    303         $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, array( 'ID' => $post_id, 'post_title' => 'Updated' ) ) ); 
     303        $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, array( 'ID' => $post_id, 'post_title' => 'Updated' ) ) ); 
     304        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
    304305        $this->assertEquals( 'Updated', get_post( $post_id )->post_title ); 
    305306 
Note: See TracChangeset for help on using the changeset viewer.