WordPress.org

Make WordPress Core

Changeset 38654


Ignore:
Timestamp:
09/26/2016 05:01:48 PM (3 years ago)
Author:
johnbillion
Message:

Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available.

Fixes #35452

Location:
trunk/tests/phpunit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-canonical.php

    r38398 r38654  
    3131        update_option( 'posts_per_page', 5 );
    3232
    33         global $wp_rewrite;
    34         $wp_rewrite->init();
    35         $wp_rewrite->set_permalink_structure( $this->structure );
    36 
     33        $this->set_permalink_structure( $this->structure );
    3734        create_initial_taxonomies();
    38 
    39         $wp_rewrite->flush_rules();
    4035    }
    4136
  • trunk/tests/phpunit/tests/canonical/https.php

    r30277 r38654  
    88class Tests_Canonical_HTTPS extends WP_Canonical_UnitTestCase {
    99    function setUp() {
    10         global $wp_rewrite;
    11 
    1210        parent::setUp();
    1311
    14         $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
     12        $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    1513        create_initial_taxonomies();
    16         $wp_rewrite->flush_rules();
    17         $wp_rewrite->init();
    1814
    1915        $this->http  = set_url_scheme( home_url( 'sample-page/' ), 'http' );
  • trunk/tests/phpunit/tests/query.php

    r38585 r38654  
    66        parent::setUp();
    77
     8        $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    89        create_initial_taxonomies();
    9         $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    1010    }
    1111
  • trunk/tests/phpunit/tests/query/verboseRewriteRules.php

    r34810 r38654  
    1111        parent::setUp();
    1212
     13        $this->set_permalink_structure( '/%category%/%year%/%postname%/' );
    1314        create_initial_taxonomies();
    14 
    15         $this->set_permalink_structure( '/%category%/%year%/%postname%/' );
    1615    }
    1716}
  • trunk/tests/phpunit/tests/rewrite.php

    r36750 r38654  
    1212        parent::setUp();
    1313
     14        $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    1415        create_initial_taxonomies();
    15 
    16         $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    1716
    1817        $this->home_url = get_option( 'home' );
     
    349348
    350349        $this->assertEquals( $post_id, url_to_postid( get_permalink( $post_id ) ) );
    351 
    352         $this->set_permalink_structure();
    353350    }
    354351
     
    386383        $this->assertTrue( is_single() );
    387384        $this->assertFalse( is_404() );
    388 
    389         $this->set_permalink_structure();
    390385    }
    391386
     
    394389     */
    395390    public function test_flush_rules_does_not_delete_option() {
    396         $this->set_permalink_structure();
     391        $this->set_permalink_structure( '' );
    397392
    398393        $rewrite_rules = get_option( 'rewrite_rules' );
Note: See TracChangeset for help on using the changeset viewer.