Changeset 768 in tests for trunk/wp-testcase/test-xmlrpc-api/test_wp_deletePost.php
- Timestamp:
- 06/30/2012 05:48:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-testcase/test-xmlrpc-api/test_wp_deletePost.php
r739 r768 1 1 <?php 2 2 3 class TestXMLRPCServer_wp_deletePost extends WP XMLRPCServerTestCase {3 class TestXMLRPCServer_wp_deletePost extends WP_XMLRPC_UnitTestCase { 4 4 5 5 function test_invalid_username_password() { … … 10 10 11 11 function test_invalid_post() { 12 $this->make_user_by_role( 'editor' ); 13 12 14 $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 0 ) ); 13 15 $this->assertInstanceOf( 'IXR_Error', $result ); … … 16 18 17 19 function test_incapable_user() { 18 $this-> _insert_quick_posts( 1);19 $post_id = array_pop( $this->post_ids);20 $this->make_user_by_role( 'subscriber' ); 21 $post_id = $this->factory->post->create(); 20 22 21 23 $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) ); 22 24 $this->assertInstanceOf( 'IXR_Error', $result ); 23 25 $this->assertEquals( 401, $result->code ); 24 25 wp_delete_post( $post_id, true );26 26 } 27 27 28 28 function test_post_deleted() { 29 $this-> _insert_quick_posts( 1);30 $post_id = array_pop( $this->post_ids);29 $this->make_user_by_role( 'editor' ); 30 $post_id = $this->factory->post->create(); 31 31 32 32 $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', $post_id ) ); … … 36 36 $post = get_post( $post_id ); 37 37 $this->assertEquals( 'trash', $post->post_status ); 38 39 wp_delete_post( $post_id, true );40 38 } 41 39 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)