WordPress.org

Make WordPress Core

Changeset 31339


Ignore:
Timestamp:
02/05/2015 07:18:16 PM (3 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/setting.php

    r31329 r31339  
    216216            $this->arrayHasKey( 'bar', $base_value );
    217217            $this->assertEquals( $base_initial_value['foo'], $base_value['foo'] );
    218             $this->assertEquals( $base_initial_value['bar'], call_user_func( $type_options['getter'], $base_name, $this->undefined )['bar'] );
     218
     219            $getter = call_user_func( $type_options['getter'], $base_name, $this->undefined );
     220            $this->assertEquals( $base_initial_value['bar'], $getter['bar'] );
    219221            $this->assertEquals( $initial_value, $setting->value() );
    220222            $setting->preview();
Note: See TracChangeset for help on using the changeset viewer.