From 9d72e1c6a2c283413606a93acf9af8e690eb2eee Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 5 Feb 2015 19:18:16 +0000 Subject: [PATCH] Use temporary variable for array in `Tests_Customize_Setting::test_preview_standard_types_multidimensional()`. The syntax previously used - `call_user_func( 'foo' )['bar']`, where `foo()` returns an array - is not valid on all supported versions of PHP, and was breaking the CI builds. See #30988. git-svn-id: https://develop.svn.wordpress.org/trunk@31339 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/customize/setting.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/customize/setting.php b/tests/phpunit/tests/customize/setting.php index effaa813e6..fec0ca0657 100644 --- a/tests/phpunit/tests/customize/setting.php +++ b/tests/phpunit/tests/customize/setting.php @@ -215,7 +215,9 @@ class Tests_WP_Customize_Setting extends WP_UnitTestCase { $this->arrayHasKey( 'foo', $base_value ); $this->arrayHasKey( 'bar', $base_value ); $this->assertEquals( $base_initial_value['foo'], $base_value['foo'] ); - $this->assertEquals( $base_initial_value['bar'], call_user_func( $type_options['getter'], $base_name, $this->undefined )['bar'] ); + + $getter = call_user_func( $type_options['getter'], $base_name, $this->undefined ); + $this->assertEquals( $base_initial_value['bar'], $getter['bar'] ); $this->assertEquals( $initial_value, $setting->value() ); $setting->preview(); $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // only applicable for custom types (not options or theme_mods)