Make WordPress Core


Ignore:
Timestamp:
10/03/2015 05:14:12 PM (10 years ago)
Author:
DrewAPicture
Message:

Tests: Introduce WP_UnitTestCase::reset_permalinks(), an attempt to DRY up logic for resetting and restoring default permalinks on setUp() and tearDown().

See #33968.

File:
1 edited

Legend:

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

    r32918 r34802  
    1717
    1818    public function setUp() {
    19         global $wp_rewrite;
    20 
    2119        parent::setUp();
    2220
     
    2523        update_option( 'posts_per_page', 5 );
    2624
     25        global $wp_rewrite;
    2726        $wp_rewrite->init();
    2827        $wp_rewrite->set_permalink_structure( $this->structure );
     28
    2929        create_initial_taxonomies();
     30
    3031        $wp_rewrite->flush_rules();
    3132    }
Note: See TracChangeset for help on using the changeset viewer.