Changeset 28074 for branches/3.7/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 04/11/2014 04:37:21 AM (12 years ago)
- Location:
- branches/3.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/admin/includesPost.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/branches/3.8 merged: 28073
- Property svn:mergeinfo changed
-
branches/3.7/tests/phpunit/tests/admin/includesPost.php
r25002 r28074 5 5 */ 6 6 class Tests_Admin_includesPost extends WP_UnitTestCase { 7 8 function tearDown() { 9 wp_set_current_user( 0 ); 10 parent::tearDown(); 11 } 7 12 8 13 function test__wp_translate_postdata_cap_checks_contributor() { … … 57 62 $this->assertEquals( 'edit_others_posts', $_results->get_error_code() ); 58 63 $this->assertEquals( 'You are not allowed to edit posts as this user.', $_results->get_error_message() ); 59 60 wp_set_current_user( 0 );61 64 } 62 65 … … 112 115 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 113 116 $this->assertEquals( 'draft', $_results['post_status'] ); 117 } 114 118 115 wp_set_current_user( 0 ); 119 /** 120 * @ticket 27734 121 */ 122 function test_edit_post_promotes_auto_draft_to_draft() { 123 $admin = $this->factory->user->create( array( 'role' => 'administrator' ) ); 124 wp_set_current_user( $admin ); 125 126 $post = get_default_post_to_edit( 'post', true ); 127 $post_data = array( 128 'post_ID' => $post->ID, 129 'post_type' => 'post', 130 'post_content' => 'Some content', 131 ); 132 $this->assertEquals( 'auto-draft', $post->post_status ); 133 edit_post( $post_data ); 134 $updated = get_post( $post->ID ); 135 $this->assertEquals( 'draft', $updated->post_status ); 116 136 } 117 137 }
Note: See TracChangeset
for help on using the changeset viewer.