From 6acb4cf24dce8f6e29ca1950796c7a3fcd54e280 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 12 Sep 2013 05:52:53 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/url.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/tests/url.php b/tests/phpunit/tests/url.php index 177a7a889e..4d962d61e3 100644 --- a/tests/phpunit/tests/url.php +++ b/tests/phpunit/tests/url.php @@ -281,6 +281,8 @@ class Tests_URL extends WP_UnitTestCase { sleep( 1 ); // get_adjacent_post() doesn't handle posts created in the same second. $post_id2 = $this->factory->post->create(); + if ( ! isset( $GLOBALS['post'] ) ) + $GLOBALS['post'] = null; $orig_post = $GLOBALS['post']; $GLOBALS['post'] = get_post( $post_id2 );