`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
This commit is contained in:
Scott Taylor 2014-07-02 19:49:05 +00:00
parent 59b255c445
commit d38227dbae
1 changed files with 5 additions and 1 deletions

View File

@ -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();