diff --git a/tests/phpunit/tests/customize/nav-menus.php b/tests/phpunit/tests/customize/nav-menus.php index 1b1ab2c21a..62550a5233 100644 --- a/tests/phpunit/tests/customize/nav-menus.php +++ b/tests/phpunit/tests/customize/nav-menus.php @@ -1144,7 +1144,12 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { $this->assertStringContainsString( ' data-customize-partial-type="nav_menu_instance"', $result ); $this->assertTrue( (bool) preg_match( '/data-customize-partial-placement-context="(.+?)"/', $result, $matches ) ); $context = json_decode( html_entity_decode( $matches[1] ), true ); - $this->assertSame( $original_args, wp_array_slice_assoc( $context, array_keys( $original_args ) ) ); // Because assertArraySubset is not available in PHP 5.2. + + foreach ( $original_args as $key => $value ) { + $this->assertArrayHasKey( $key, $context ); + $this->assertSame( $value, $context[ $key ] ); + } + $this->assertTrue( $context['can_partial_refresh'] ); } diff --git a/tests/phpunit/tests/widgets/wpWidgetMedia.php b/tests/phpunit/tests/widgets/wpWidgetMedia.php index 74b3ac8b99..921e099770 100644 --- a/tests/phpunit/tests/widgets/wpWidgetMedia.php +++ b/tests/phpunit/tests/widgets/wpWidgetMedia.php @@ -95,8 +95,15 @@ class Tests_Widgets_wpWidgetMedia extends WP_UnitTestCase { $this->assertSame( $id_base, $widget->id_base ); $this->assertSame( $name, $widget->name ); - $this->assertArraySubset( $widget_options, $widget->widget_options ); - $this->assertArraySubset( $control_options, $widget->control_options ); + foreach ( $widget_options as $key => $value ) { + $this->assertArrayHasKey( $key, $widget->widget_options ); + $this->assertSame( $value, $widget->widget_options[ $key ] ); + } + + foreach ( $control_options as $key => $value ) { + $this->assertArrayHasKey( $key, $widget->control_options ); + $this->assertSame( $value, $widget->control_options[ $key ] ); + } } /**