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/rewrite.php

    r32149 r47329  
    99
    1010    function setUp() {
     11        global $wp_rewrite;
    1112        parent::setUp();
    1213
    1314        // Need rewrite rules in place to use url_to_postid
    14         global $wp_rewrite;
    15         update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' );
     15        $wp_rewrite->init();
     16        $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
     17
    1618        create_initial_taxonomies();
    17         $GLOBALS['wp_rewrite']->init();
    18         flush_rewrite_rules();
     19
     20        $wp_rewrite->flush_rules();
    1921    }
    2022
    2123    function tearDown() {
    22         $GLOBALS['wp_rewrite']->init();
     24        global $wp_rewrite;
     25        $wp_rewrite->init();
     26
    2327        parent::tearDown();
    2428    }
     
    3539    function test_url_to_postid_custom_post_type() {
    3640        delete_option( 'rewrite_rules' );
    37        
     41
    3842        $post_type = rand_str( 12 );
    3943        register_post_type( $post_type, array( 'public' => true ) );
    40        
     44
    4145        $id = $this->factory->post->create( array( 'post_type' => $post_type ) );
    42         $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );     
    43        
    44         _unregister_post_type( $post_type );       
     46        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
     47
     48        _unregister_post_type( $post_type );
    4549    }
    46    
     50
    4751    function test_url_to_postid_hierarchical() {
    4852
Note: See TracChangeset for help on using the changeset viewer.