Changeset 27405 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 03/05/2014 06:25:31 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesPost.php
r25002 r27405 115 115 wp_set_current_user( 0 ); 116 116 } 117 118 /** 119 * edit_post() should convert an existing auto-draft to a draft. 120 * 121 * @ticket 25272 122 */ 123 function test_edit_post_auto_draft() { 124 $user_id = $this->factory->user->create( array( 'role' => 'editor' ) ); 125 wp_set_current_user( $user_id ); 126 $post = $this->factory->post->create_and_get( array( 'post_status' => 'auto-draft' ) ); 127 $this->assertEquals( 'auto-draft', $post->post_status ); 128 $post_data = array( 129 'post_title' => 'Post title', 130 'content' => 'Post content', 131 'post_type' => 'post', 132 'post_ID' => $post->ID, 133 ); 134 edit_post( $post_data ); 135 $this->assertEquals( 'draft', get_post( $post->ID )->post_status ); 136 wp_set_current_user( 0 ); 137 } 138 117 139 }
Note: See TracChangeset
for help on using the changeset viewer.