Setup rewrite changes in tests in a predictable fashion. Don't mix method calls with wrapper function calls.

See #28706.


git-svn-id: https://develop.svn.wordpress.org/trunk@28966 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-03 01:42:57 +00:00
parent 73bde8a278
commit f23a5ef832
7 changed files with 53 additions and 36 deletions

View File

@@ -23,15 +23,19 @@ class Tests_Query_Conditionals extends WP_UnitTestCase {
update_option( 'posts_per_page', 5 );
global $wp_rewrite;
update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' );
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
create_initial_taxonomies();
$GLOBALS['wp_rewrite']->init();
flush_rewrite_rules();
$wp_rewrite->flush_rules();
}
function tearDown() {
global $wp_rewrite;
parent::tearDown();
$GLOBALS['wp_rewrite']->init();
$wp_rewrite->init();
}
function test_home() {