Changeset 51450
- Timestamp:
- 07/17/2021 10:23:57 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/Autosave.php
r49603 r51450 35 35 self::$user_ids[] = self::$editor_id; 36 36 37 // Set a user so the $post has 'post_author'. 38 wp_set_current_user( self::$admin_id ); 39 37 40 self::$post_id = $factory->post->create( array( 'post_status' => 'draft' ) ); 38 41 self::$post = get_post( self::$post_id ); 39 }40 41 /**42 * Sets up the test fixture.43 */44 public function setUp() {45 parent::setUp();46 // Set a user so the $post has 'post_author'.47 wp_set_current_user( self::$admin_id );48 42 } 49 43 … … 63 57 'wp_autosave' => array( 64 58 'post_id' => self::$post_id, 65 '_wpnonce' => wp_create_nonce( 'update-post_' . self::$post ->ID),59 '_wpnonce' => wp_create_nonce( 'update-post_' . self::$post_id ), 66 60 'post_content' => self::$post->post_content . PHP_EOL . $md5, 67 61 'post_type' => 'post', … … 86 80 // Check that the edit happened. 87 81 $post = get_post( self::$post_id ); 88 $this->assert GreaterThanOrEqual( 0, strpos( self::$post->post_content, $md5 ) );82 $this->assertNotFalse( strpos( $post->post_content, $md5 ) ); 89 83 } 90 84 … … 137 131 $autosave = wp_get_post_autosave( self::$post_id, get_current_user_id() ); 138 132 $this->assertNotEmpty( $autosave ); 139 $this->assert GreaterThanOrEqual( 0,strpos( $autosave->post_content, $md5 ) );133 $this->assertNotFalse( strpos( $autosave->post_content, $md5 ) ); 140 134 } 141 135
Note: See TracChangeset
for help on using the changeset viewer.