Changeset 595 in tests for wp-testcase/test-xmlrpc-api/test_mw_newPost.php
- Timestamp:
- 03/29/2012 01:11:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test-xmlrpc-api/test_mw_newPost.php
r592 r595 109 109 } 110 110 111 function test_incapable_set_post_type_as_page() { 112 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 113 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 114 $this->assertInstanceOf( 'IXR_Error', $result ); 115 $this->assertEquals( 401, $result->code ); 116 } 117 118 function test_capable_set_post_type_as_page() { 119 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 120 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 121 $this->assertNotInstanceOf( 'IXR_Error', $result ); 122 $this->assertStringMatchesFormat( '%d', $result ); 123 124 $out = wp_get_single_post( $result ); 125 $this->assertEquals( 'Test', $out->post_title ); 126 $this->assertEquals( 'page', $out->post_type ); 127 } 128 111 129 }
Note: See TracChangeset
for help on using the changeset viewer.