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
This commit is contained in:
Boone Gorges 2015-02-05 19:18:16 +00:00
parent c9c9af5df8
commit 9d72e1c6a2
1 changed files with 3 additions and 1 deletions

View File

@ -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)