Changeset 1315 in tests
- Timestamp:
- 07/21/2013 12:46:13 AM (12 years ago)
- Location:
- trunk/tests/xmlrpc/wp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/xmlrpc/wp/getRevisions.php
r1252 r1315 34 34 35 35 $post_id = $this->factory->post->create(); 36 wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 1' ) ); // Create the initial revision 36 37 37 38 $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) ); … … 39 40 $this->assertCount( 1, $result ); 40 41 41 wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 1' ) );42 wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 2' ) ); 42 43 43 44 $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) ); -
trunk/tests/xmlrpc/wp/restoreRevision.php
r1254 r1315 11 11 parent::setUp(); 12 12 13 $this->post_id = $this->factory->post->create( array( 'post_content' => 'edit1' ) ); 14 wp_insert_post( array( 'ID' => $this->post_id, 'post_content' => 'edit2' ) ); 13 $this->post_id = $this->factory->post->create( array( 'post_content' => 'edit1' ) ); // Not saved as a revision 14 // First saved revision on update, see http://core.trac.wordpress.org/changeset/24650 15 wp_insert_post( array( 'ID' => $this->post_id, 'post_content' => 'edit2' ) ); 15 16 16 17 $revisions = wp_get_post_revisions( $this->post_id ); 17 $revision = array_shift( $revisions ); // First revision is empty - http://core.trac.wordpress.org/changeset/23842 18 //$revision = array_shift( $revisions ); // First revision is empty - http://core.trac.wordpress.org/changeset/23842 19 // First revision is NOT empty, see http://core.trac.wordpress.org/changeset/24650 18 20 $revision = array_shift( $revisions ); 19 21 $this->revision_id = $revision->ID; … … 46 48 $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) ); 47 49 $this->assertTrue( $result ); 48 $this->assertEquals( 'edit 1', get_post( $this->post_id )->post_content );50 $this->assertEquals( 'edit2', get_post( $this->post_id )->post_content ); 49 51 } 50 52 }
Note: See TracChangeset
for help on using the changeset viewer.