From 7f9edd3e6924d2ec155bed9dbba43e7b852648cf Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 22 Jul 2014 17:21:40 +0000 Subject: [PATCH] After [29251], set the array keys in `WP_UnitTestCase::$hooks_saved` to prevent notices in 3rd party use cases. Props danielbachhuber. Fixes #28986. git-svn-id: https://develop.svn.wordpress.org/trunk@29267 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/testcase.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index ba66439798..c5960bd162 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -11,7 +11,12 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { protected $expected_doing_it_wrong = array(); protected $caught_doing_it_wrong = array(); - protected static $hooks_saved = array(); + protected static $hooks_saved = array( + 'merged_filters' => array(), + 'wp_actions' => array(), + 'wp_current_filter' => array(), + 'wp_filter' => array(), + ); protected static $ignore_files; /** @@ -101,7 +106,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $GLOBALS[ $key ] = self::$hooks_saved[ $key ]; } } - + function flush_cache() { global $wp_object_cache; $wp_object_cache->group_ops = array();