Make WordPress Core


Ignore:
Timestamp:
02/22/2020 12:05:12 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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

Among other fixes, this backports [26087], [26091], [26095], [26252], [26307], [26318], [26512], [26705], [26871], [26909-26910], [26940], [27086], [27168], [28799], [28873], [28943], [28961], [28964], [28966-28967], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [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.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/tests/phpunit/tests/canonical.php

    r32151 r47343  
    2020
    2121        function setUp() {
     22                global $wp_rewrite;
     23
    2224                parent::setUp();
    2325
     26                update_option( 'page_comments', true );
    2427                update_option( 'comments_per_page', 5 );
    2528                update_option( 'posts_per_page', 5 );
    2629
    27                 update_option( 'permalink_structure', $this->structure );
     30                $wp_rewrite->init();
     31                $wp_rewrite->set_permalink_structure( $this->structure );
     32
    2833                create_initial_taxonomies();
    29                 $GLOBALS['wp_rewrite']->init();
    30                 flush_rewrite_rules();
     34
     35                $wp_rewrite->flush_rules();
    3136
    3237                $this->old_current_user = get_current_user_id();
    … …  
    8085
    8186        function tearDown() {
     87                global $wp_rewrite;
    8288                wp_set_current_user( $this->old_current_user );
    8389
    84                 $GLOBALS['wp_rewrite']->init();
     90                $wp_rewrite->init();
    8591                parent::tearDown();
    8692        }
    … …  
    168174                        // Categories
    169175
    170                         array( '?cat=%d', '/category/parent/', 15256 ),
    171                         array( '?cat=%d', '/category/parent/child-1/', 15256 ),
    172176                        array( '?cat=%d', '/category/parent/child-1/child-2/' ), // no children
    173177                        array( '/category/uncategorized/', array( 'url' => '/category/uncategorized/', 'qv' => array( 'category_name' => 'uncategorized' ) ) ),
    … …  
    175179                        array( '/category/uncategorized/?paged=2', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ),
    176180                        array( '/category/uncategorized/?paged=2&category_name=uncategorized', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ), 17174 ),
    177                         array( '/category/child-1/', '/category/parent/child-1/', 18734 ),
    178                         array( '/category/foo/child-1/', '/category/parent/child-1/', 18734 ),
    179181
    180182                        // Categories & Intersections with other vars
    … …  
    186188
    187189                        // Categories with Dates
    188                         array( '/category/uncategorized/?paged=2&year=2008', array( 'url' => '/category/uncategorized/page/2/?year=2008', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2, 'year' => 2008) ), 17661 ),
    189 //                      array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ),
    190                         array( '/2008/04/?cat=1', array( 'url' => '/category/uncategorized/?year=2008&monthnum=04', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ),
     190                        array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ),
    191191//                      array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ),
    192                         array( '/2008/?category_name=cat-a', array( 'url' => '/category/cat-a/?year=2008', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ), 20386 ),
    193 //                      array( '/category/uncategorized/?year=2008', array( 'url' => '/2008/?category_name=uncategorized', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),
    194                         array( '/category/uncategorized/?year=2008', array( 'url' => '/category/uncategorized/?year=2008', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),
    195192
    196193                        // Pages
    197                         array( '/sample%20page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 17653 ), // Page rules always set 'page'
    198                         array( '/sample------page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 14773 ),
    199194                        array( '/child-page-1/', '/parent-page/child-page-1/'),
    200195                        array( '/?page_id=144', '/parent-page/child-page-1/'),
    … …  
    216211
    217212                        array( '/2008/09/03/images-test/3/', array( 'url' => '/2008/09/03/images-test/3/', 'qv' => array( 'name' => 'images-test', 'year' => '2008', 'monthnum' => '09', 'day' => '03', 'page' => '/3' ) ) ), // page = /3 ?!
    218                         array( '/2008/09/03/images-test/8/', '/2008/09/03/images-test/4/', 11694 ), // post with 4 pages
    219213                        array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ),
    220214                        array( '/2008/09/03/images-te?page=3', '/2008/09/03/images-test/3/' ),
    221215
    222216                        // Comments
    223                         array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/', 20388 ),
    224                         array( '/2008/03/03/comment-test/comment-page-20/', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages
    225                         array( '/2008/03/03/comment-test/?cpage=30', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages
     217                        array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/' ),
    226218
    227219                        // Attachments
    … …  
    246238                        array( '/?author=%d', '/author/canonical-author/' ),
    247239//                      array( '/?author=%d&year=2008', '/2008/?author=3'),
    248                         array( '/?author=%d&year=2008', '/author/canonical-author/?year=2008', 17661 ),
    249240//                      array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase.
    250                         array( '/author/canonical-author/?year=2008', '/author/canonical-author/?year=2008', 17661 ),
    251241
    252242                        // Feeds
Note: See TracChangeset for help on using the changeset viewer.