Make WordPress Core


Ignore:
Timestamp:
02/20/2020 05:04:42 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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

Among other fixes, this backports [28943], [28961], [28964-28968], [28988], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30160], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30523-30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [33374], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

  • branches/3.9/tests/phpunit/tests/link.php

    r27836 r47329  
    44 */
    55class Tests_Link extends WP_UnitTestCase {
     6
     7    function tearDown() {
     8        global $wp_rewrite;
     9        $wp_rewrite->init();
     10        parent::tearDown();
     11    }
    612
    713    function _get_pagenum_link_cb( $url ) {
     
    3036
    3137    function test_wp_get_shortlink() {
     38        global $wp_rewrite;
     39
    3240        $post_id = $this->factory->post->create();
    3341        $post_id2 = $this->factory->post->create();
     42
     43        $wp_rewrite->init();
     44        $wp_rewrite->set_permalink_structure( '' );
     45        $wp_rewrite->flush_rules();
    3446
    3547        // Basic case
     
    6072        $this->assertEquals( '', wp_get_shortlink() );
    6173
    62         global $wp_rewrite;
    63         $wp_rewrite->permalink_structure = '';
    6474        $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    6575        $wp_rewrite->flush_rules();
     
    7484        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) );
    7585        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink() );
    76 
    77         $wp_rewrite->set_permalink_structure( '' );
    78         $wp_rewrite->flush_rules();
    7986    }
    8087
     
    8794
    8895        global $wp_rewrite;
    89         $wp_rewrite->permalink_structure = '';
    9096        $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    9197        $wp_rewrite->flush_rules();
    9298
    9399        $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
    94 
    95         $wp_rewrite->set_permalink_structure( '' );
    96         $wp_rewrite->flush_rules();
    97100    }
    98101
     
    113116
    114117        $this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
    115 
    116         $wp_rewrite->set_permalink_structure( '' );
    117         $wp_rewrite->flush_rules();
    118118    }
    119119
Note: See TracChangeset for help on using the changeset viewer.