From ac936037b1dc713eba7610aabbfae473603f57be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 5 Nov 2021 13:07:05 +0100 Subject: [PATCH] Make tests pure --- phpunit/class-wp-theme-json-test.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 912a9a7b9938b1..d8c9f47a146072 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -1674,43 +1674,40 @@ function test_get_editor_settings_blank() { function test_get_editor_settings_custom_units_can_be_disabled() { add_theme_support( 'custom-units', array() ); - $input = gutenberg_get_default_block_editor_settings(); + $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_default_block_editor_settings() ); + remove_theme_support( 'custom-units' ); $expected = array( 'units' => array( array() ), 'padding' => false, ); - $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( $input ); - $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] ); } function test_get_editor_settings_custom_units_can_be_enabled() { add_theme_support( 'custom-units' ); - $input = gutenberg_get_default_block_editor_settings(); + $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_default_block_editor_settings() ); + remove_theme_support( 'custom-units' ); $expected = array( 'units' => array( 'px', 'em', 'rem', 'vh', 'vw', '%' ), 'padding' => false, ); - $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( $input ); - $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] ); } function test_get_editor_settings_custom_units_can_be_filtered() { add_theme_support( 'custom-units', 'rem', 'em' ); - $input = gutenberg_get_default_block_editor_settings(); + $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_default_block_editor_settings() ); + remove_theme_support( 'custom-units' ); $expected = array( 'units' => array( 'rem', 'em' ), 'padding' => false, ); - $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( $input ); - $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] ); }