mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Fix the failing Tests_Link::test_wp_get_shortlink() assertion:
* `wp_get_shortlink()` was firing a notice when reading `$post->ID` while `$post` was null in some cases * Before the assertions that assume `$GLOBALS['post']` is not set, call `unset( $GLOBALS['post'] );` - there was global spillage from other tests See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25404 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,6 +35,8 @@ class Tests_Link extends WP_UnitTestCase {
|
||||
// Basic case
|
||||
$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
|
||||
|
||||
unset( $GLOBALS['post'] );
|
||||
|
||||
// Global post is not set
|
||||
$this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
|
||||
$this->assertEquals( '', wp_get_shortlink( 0 ) );
|
||||
|
||||
Reference in New Issue
Block a user