From 248fc182b8527c84c24de4c1dfcada14e66ba743 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 16 Oct 2014 04:22:16 +0000 Subject: [PATCH] Fix `Tests_Paginate_Links` tests by properly setting up / tearing down permalink structure. Props jorbin. Fixes #29636. git-svn-id: https://develop.svn.wordpress.org/trunk@29913 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/general/paginateLinks.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/phpunit/tests/general/paginateLinks.php b/tests/phpunit/tests/general/paginateLinks.php index 8fae1f61f1..df8fda1dd4 100644 --- a/tests/phpunit/tests/general/paginateLinks.php +++ b/tests/phpunit/tests/general/paginateLinks.php @@ -3,11 +3,21 @@ class Tests_Paginate_Links extends WP_UnitTestCase { private $i18n_count = 0; + private $permalink_structure = ''; function setUp() { parent::setUp(); + global $wp_rewrite; $this->go_to( home_url( '/' ) ); + + $this->permalink_structure = $wp_rewrite->permalink_structure; + $wp_rewrite->set_permalink_structure( get_option( 'permalink_structure' ) ); + } + + function tearDown() { + global $wp_rewrite; + $wp_rewrite->set_permalink_structure( $this->permalink_structure ); } function test_defaults() {