Don't assume `$GLOBALS['post']` is set in `tests/url.php`.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f4ac65db2d
commit
6acb4cf24d
|
@ -281,6 +281,8 @@ class Tests_URL extends WP_UnitTestCase {
|
||||||
sleep( 1 ); // get_adjacent_post() doesn't handle posts created in the same second.
|
sleep( 1 ); // get_adjacent_post() doesn't handle posts created in the same second.
|
||||||
$post_id2 = $this->factory->post->create();
|
$post_id2 = $this->factory->post->create();
|
||||||
|
|
||||||
|
if ( ! isset( $GLOBALS['post'] ) )
|
||||||
|
$GLOBALS['post'] = null;
|
||||||
$orig_post = $GLOBALS['post'];
|
$orig_post = $GLOBALS['post'];
|
||||||
$GLOBALS['post'] = get_post( $post_id2 );
|
$GLOBALS['post'] = get_post( $post_id2 );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue