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/tests/general/paginateLinks.php

    r32359 r34802  
    44
    55    private $i18n_count = 0;
    6     private $permalink_structure = '';
    76
    87    function setUp() {
    98        parent::setUp();
    10         global $wp_rewrite;
    119
    1210        $this->go_to( home_url( '/' ) );
    13 
    14         $this->permalink_structure = $wp_rewrite->permalink_structure;
    15         $wp_rewrite->set_permalink_structure( get_option( 'permalink_structure' ) );
    16     }
    17 
    18     function tearDown() {
    19         global $wp_rewrite;
    20         $wp_rewrite->set_permalink_structure( $this->permalink_structure );
    2111    }
    2212
Note: See TracChangeset for help on using the changeset viewer.