Make WordPress Core


Ignore:
Timestamp:
02/21/2020 01:05:39 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Fix the Travis CI build for the 3.8 branch.

Among other fixes, this backports [26871], [26909-26910], [26940], [27086], [27168], [28799], [28873], [28943], [28961], [28964], [28966-28967], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30160], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [40241], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/tests/phpunit/tests/post/revisions.php

    r32150 r47338  
    5454
    5555        wp_set_current_user( 0 );
    56     }
    57 
    58     /**
    59     * @ticket 7392
    60     * @ticket 9843
    61     */
    62     function test_revision_dont_save_revision_if_unchanged() {
    63         $post = get_default_post_to_edit( 'post', true );
    64         $post_id = $post->ID;
    65 
    66         $this->assertCount( 0, wp_get_post_revisions( $post_id ) ); // No revisions on auto-draft creation.
    67 
    68         wp_update_post( array( 'post_status' => 'draft', 'post_title' => 'some-post', 'post_content' => 'some_content', 'ID' => $post_id ) );
    69 
    70         $this->assertCount( 1, wp_get_post_revisions( $post_id ) ); // Just the initial revision
    71 
    72         // First update
    73         wp_update_post( array( 'post_content'   => 'some updated content', 'ID' => $post_id ) );
    74 
    75         $this->assertCount( 2, wp_get_post_revisions( $post_id ) ); // should be 2 revisions so far
    76 
    77         //update the post
    78         wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) ); //2nd revision
    79         $this->assertCount( 3, wp_get_post_revisions( $post_id ) ); // should be 3 revision so far
    80 
    81         //next try to save another identical update, tests for patch that prevents storing duplicates
    82         wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) ); //content unchanged, shouldn't save
    83         $this->assertCount( 3, wp_get_post_revisions( $post_id ) ); //should still be 3 revision
    84 
    85         //next try to save another update, same content, but new ttile, should save revision
    86         wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'  => 'new update for some updated content', 'ID' => $post_id ) );
    87         $this->assertCount( 4, wp_get_post_revisions( $post_id ) ); //should  be 4 revision
    88 
    89         //next try to save another identical update
    90         wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'  => 'new update for some updated content', 'ID' => $post_id ) ); //content unchanged, shouldn't save
    91         $this->assertCount( 4, wp_get_post_revisions( $post_id ) ); //should still be 4 revision
    9256    }
    9357
Note: See TracChangeset for help on using the changeset viewer.