Make WordPress Core


Ignore:
Timestamp:
10/03/2015 05:14:12 PM (11 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/query/results.php

    r33706 r34802  
    684684         */
    685685        function test_child_post_in_hierarchical_post_type_with_default_permalinks() {
    686                 global $wp_rewrite;
    687 
    688                 $old_permastruct = get_option( 'permalink_structure' );
    689                 $wp_rewrite->set_permalink_structure( '' );
    690                 $wp_rewrite->flush_rules();
    691 
    692686                register_post_type( 'handbook', array( 'hierarchical' => true ) );
    693687
    … …  
    699693                $result = $this->q->query( array( 'handbook' => 'contributing-to-the-wordpress-codex/getting-started', 'post_type' => 'handbook' ) );
    700694                $this->assertCount( 1, $result );
    701 
    702                 $wp_rewrite->set_permalink_structure( $old_permastruct );
    703                 $wp_rewrite->flush_rules();
    704695        }
    705696
Note: See TracChangeset for help on using the changeset viewer.