Ticket #24916: TestMetaWeblogChangeAuthorToSelf.patch
| File TestMetaWeblogChangeAuthorToSelf.patch, 2.1 KB (added by , 13 years ago) |
|---|
-
tests/xmlrpc/mw/editPost.php
95 95 $this->assertEquals( $contributor_id, $out->post_author ); 96 96 } 97 97 98 /** 99 * @ticket 24916 100 */ 101 function test_capable_reassign_author_to_self() { 102 $contributor_id = $this->make_user_by_role( 'contributor' ); 103 $editor_id = $this->make_user_by_role( 'editor' ); 104 105 $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id ); 106 $post_id = wp_insert_post( $post ); 107 108 $post2 = array( 'wp_author_id' => $editor_id ); 109 $out = get_post( $post_id ); 110 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) ); 111 $this->assertNotInstanceOf( 'IXR_Error', $result ); 112 $this->assertTrue($result); 113 114 $out = get_post( $post_id ); 115 $this->assertEquals( $editor_id, $out->post_author ); 116 } 117 98 118 function test_post_thumbnail() { 99 119 add_theme_support( 'post-thumbnails' ); 100 120 -
tests/xmlrpc/wp/editPost.php
95 95 $this->assertEquals( $contributor_id, $out->post_author ); 96 96 } 97 97 98 /** 99 * @ticket 24916 100 */ 101 function test_capable_reassign_author_to_self() { 102 $contributor_id = $this->make_user_by_role( 'contributor' ); 103 $editor_id = $this->make_user_by_role( 'editor' ); 104 105 $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id ); 106 $post_id = wp_insert_post( $post ); 107 108 $post2 = array( 'post_author' => $editor_id ); 109 $out = get_post( $post_id ); 110 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) ); 111 $this->assertNotInstanceOf( 'IXR_Error', $result ); 112 $this->assertTrue($result); 113 114 $out = get_post( $post_id ); 115 $this->assertEquals( $editor_id, $out->post_author ); 116 } 117 98 118 function test_post_thumbnail() { 99 119 add_theme_support( 'post-thumbnails' ); 100 120
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)