Tests: Introduce WP_UnitTestCase::reset_permalinks(), an attempt to DRY up logic for resetting and restoring default permalinks on setUp() and tearDown().

See #33968.


git-svn-id: https://develop.svn.wordpress.org/trunk@34802 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes
2015-10-03 17:14:12 +00:00
parent 4fc732d804
commit adffdab161
18 changed files with 56 additions and 245 deletions
+1 -3
View File
@@ -429,7 +429,7 @@ class Tests_Post extends WP_UnitTestCase {
$post = get_post( $p );
$wp_rewrite->set_permalink_structure( '' );
$this->reset_permalinks();
$this->assertEquals( "$p-2", $post->post_name );
}
@@ -525,8 +525,6 @@ class Tests_Post extends WP_UnitTestCase {
// permalink should include the post ID at the end
$this->assertEquals(get_option('siteurl').'/2007/10/31/'.$id.'/', $plink);
$wp_rewrite->set_permalink_structure('');
}
/**