Make sure hundreds of canonical tests don't fail in multisite every other time they are run.

See #28706.


git-svn-id: https://develop.svn.wordpress.org/trunk@28964 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-07-03 00:49:32 +00:00
parent 53f98b80b7
commit 80a817ebcc
2 changed files with 9 additions and 4 deletions

View File

@ -19,16 +19,20 @@ class Tests_Canonical extends WP_UnitTestCase {
var $term_ids;
function setUp() {
global $wp_rewrite;
parent::setUp();
update_option( 'page_comments', true );
update_option( 'comments_per_page', 5 );
update_option( 'posts_per_page', 5 );
update_option( 'permalink_structure', $this->structure );
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure( $this->structure );
create_initial_taxonomies();
$GLOBALS['wp_rewrite']->init();
flush_rewrite_rules();
$wp_rewrite->flush_rules();
$this->old_current_user = get_current_user_id();
$this->author_id = $this->factory->user->create( array( 'user_login' => 'canonical-author' ) );

View File

@ -34,8 +34,9 @@ class Tests_Link extends WP_UnitTestCase {
$post_id = $this->factory->post->create();
$post_id2 = $this->factory->post->create();
$wp_rewrite->permalink_structure = '';
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure( '' );
$wp_rewrite->flush_rules();
// Basic case
$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );