Make WordPress Core

Changeset 1315 in tests


Ignore:
Timestamp:
07/21/2013 12:46:13 AM (13 years ago)
Author:
ryan
Message:

Update revision unit tests to reflect how initial revisions are now created.

see [24650] #24708

Props adamsilverstein

Location:
trunk/tests/xmlrpc/wp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/xmlrpc/wp/getRevisions.php

    r1252 r1315  
    3434
    3535                $post_id = $this->factory->post->create();
     36                wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 1' ) ); // Create the initial revision
    3637
    3738                $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
     
    3940                $this->assertCount( 1, $result );
    4041
    41                 wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 1' ) );
     42                wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 2' ) );
    4243
    4344                $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
  • trunk/tests/xmlrpc/wp/restoreRevision.php

    r1254 r1315  
    1111                parent::setUp();
    1212
    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' ) );
    1516
    1617                $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
    1820                $revision = array_shift( $revisions );
    1921                $this->revision_id = $revision->ID;
     
    4648                $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
    4749                $this->assertTrue( $result );
    48                 $this->assertEquals( 'edit1', get_post( $this->post_id )->post_content );
     50                $this->assertEquals( 'edit2', get_post( $this->post_id )->post_content );
    4951        }
    5052}
Note: See TracChangeset for help on using the changeset viewer.