From d38227dbae882e04a6c1dae6cb0fb117686eb26f Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Jul 2014 19:49:05 +0000 Subject: [PATCH] `test_wp_get_shortlink()` assumes permalink structure is '' when it starts. It is not. See #28706. git-svn-id: https://develop.svn.wordpress.org/trunk@28961 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/link.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/link.php b/tests/phpunit/tests/link.php index 28d504dbef..9dd2750be9 100644 --- a/tests/phpunit/tests/link.php +++ b/tests/phpunit/tests/link.php @@ -29,9 +29,14 @@ class Tests_Link extends WP_UnitTestCase { } function test_wp_get_shortlink() { + global $wp_rewrite; + $post_id = $this->factory->post->create(); $post_id2 = $this->factory->post->create(); + $wp_rewrite->permalink_structure = ''; + $wp_rewrite->set_permalink_structure( '' ); + // Basic case $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) ); @@ -59,7 +64,6 @@ class Tests_Link extends WP_UnitTestCase { $this->assertEquals( '', wp_get_shortlink( 0 ) ); $this->assertEquals( '', wp_get_shortlink() ); - global $wp_rewrite; $wp_rewrite->permalink_structure = ''; $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); $wp_rewrite->flush_rules();