Make WordPress Core


Ignore:
Timestamp:
10/13/2015 03:21:20 PM (9 years ago)
Author:
boonebgorges
Message:

In WP_UnitTestCase, only flush rewrite rules when they're set.

See [34810]. See #33968.

File:
1 edited

Legend:

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

    r34828 r35136  
    3131        }
    3232
    33         global $wpdb;
     33        global $wpdb, $wp_rewrite;
    3434        $wpdb->suppress_errors = false;
    3535        $wpdb->show_errors = true;
     
    4949            $this->reset_taxonomies();
    5050            $this->reset_post_statuses();
    51             $this->set_permalink_structure();
     51
     52            if ( $wp_rewrite->permalink_structure ) {
     53                $this->set_permalink_structure( '' );
     54            }
    5255        }
    5356
Note: See TracChangeset for help on using the changeset viewer.