From a668ff39fc8765c69437ff37b5e94b6ddb74e4e7 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:22:52 +1100 Subject: [PATCH 01/13] Backport min-height block support feature --- src/wp-includes/block-supports/dimensions.php | 25 +++- src/wp-includes/class-wp-theme-json.php | 14 +- .../style-engine/class-wp-style-engine.php | 11 ++ .../tests/block-supports/dimensions.php | 138 ++++++++++++++++++ .../tests/style-engine/styleEngine.php | 15 ++ 5 files changed, 196 insertions(+), 7 deletions(-) create mode 100644 tests/phpunit/tests/block-supports/dimensions.php diff --git a/src/wp-includes/block-supports/dimensions.php b/src/wp-includes/block-supports/dimensions.php index 3223dbe0af4ac..31e25e11454f0 100644 --- a/src/wp-includes/block-supports/dimensions.php +++ b/src/wp-includes/block-supports/dimensions.php @@ -29,8 +29,7 @@ function wp_register_dimensions_support( $block_type ) { return; } - $has_dimensions_support = block_has_support( $block_type, array( '__experimentalDimensions' ), false ); - // Future block supports such as height & width will be added here. + $has_dimensions_support = block_has_support( $block_type, array( 'dimensions' ), false ); if ( $has_dimensions_support ) { $block_type->attributes['style'] = array( @@ -44,6 +43,7 @@ function wp_register_dimensions_support( $block_type ) { * This will be applied to the block markup in the front-end. * * @since 5.9.0 + * @since 6.2.0 Added `minHeight` support. * @access private * * @param WP_Block_Type $block_type Block Type. @@ -51,16 +51,31 @@ function wp_register_dimensions_support( $block_type ) { * @return array Block dimensions CSS classes and inline styles. */ function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable - if ( wp_should_skip_block_supports_serialization( $block_type, '__experimentalDimensions' ) ) { + if ( wp_should_skip_block_supports_serialization( $block_type, 'dimensions' ) ) { return array(); } $styles = array(); - // Height support to be added in near future. // Width support to be added in near future. - return empty( $styles ) ? array() : array( 'style' => implode( ' ', $styles ) ); + $has_min_height_support = block_has_support( $block_type, array( 'dimensions', 'minHeight' ), false ); + $block_styles = isset( $block_attributes['style'] ) ? $block_attributes['style'] : null; + + if ( ! $block_styles ) { + return $attributes; + } + + $skip_min_height = wp_should_skip_block_supports_serialization( $block_type, 'dimensions', 'minHeight' ); + $dimensions_block_styles = array(); + $dimensions_block_styles['minHeight'] = $has_min_height_support && ! $skip_min_height ? _wp_array_get( $block_styles, array( 'dimensions', 'minHeight' ), null ) : null; + $styles = wp_style_engine_get_styles( array( 'dimensions' => $dimensions_block_styles ) ); + + if ( ! empty( $styles['css'] ) ) { + $attributes['style'] = $styles['css']; + } + + return $attributes; } // Register the block support. diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 2e39b3c3530d2..2a4798d2d032b 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -192,7 +192,7 @@ class WP_Theme_JSON { * @since 6.1.0 Added the `border-*-color`, `border-*-width`, `border-*-style`, * `--wp--style--root--padding-*`, and `box-shadow` properties, * removed the `--wp--style--block-gap` property. - * @since 6.2.0 Added `outline-*` properties. + * @since 6.2.0 Added `outline-*`, and `min-height` properties. * * @var array */ @@ -231,6 +231,7 @@ class WP_Theme_JSON { 'margin-right' => array( 'spacing', 'margin', 'right' ), 'margin-bottom' => array( 'spacing', 'margin', 'bottom' ), 'margin-left' => array( 'spacing', 'margin', 'left' ), + 'min-height' => array( 'dimensions', 'minHeight' ), 'outline-color' => array( 'outline', 'color' ), 'outline-offset' => array( 'outline', 'offset' ), 'outline-style' => array( 'outline', 'style' ), @@ -293,6 +294,7 @@ class WP_Theme_JSON { * and `typography`, and renamed others according to the new schema. * @since 6.0.0 Added `color.defaultDuotone`. * @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`. + * @since 6.2.0 Added `dimensions.minHeight`. * @var array */ const VALID_SETTINGS = array( @@ -319,6 +321,9 @@ class WP_Theme_JSON { 'text' => null, ), 'custom' => null, + 'dimensions' => array( + 'minHeight' => null, + ), 'layout' => array( 'contentSize' => null, 'definitions' => null, @@ -358,7 +363,7 @@ class WP_Theme_JSON { * @since 6.1.0 Added new side properties for `border`, * added new property `shadow`, * updated `blockGap` to be allowed at any level. - * @since 6.2.0 Added `outline` properties. + * @since 6.2.0 Added `outline`, and `minHeight` properties. * * @var array */ @@ -378,6 +383,9 @@ class WP_Theme_JSON { 'gradient' => null, 'text' => null, ), + 'dimensions' => array( + 'minHeight' => null, + ), 'filter' => array( 'duotone' => null, ), @@ -490,6 +498,7 @@ public static function get_element_class_name( $element ) { * Options that settings.appearanceTools enables. * * @since 6.0.0 + * @since 6.2.0 Added `dimensions.minHeight` * @var array */ const APPEARANCE_TOOLS_OPT_INS = array( @@ -498,6 +507,7 @@ public static function get_element_class_name( $element ) { array( 'border', 'style' ), array( 'border', 'width' ), array( 'color', 'link' ), + array( 'dimensions', 'minHeight' ), array( 'spacing', 'blockGap' ), array( 'spacing', 'margin' ), array( 'spacing', 'padding' ), diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 951dac4b543eb..e24ad63a0e89e 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -137,6 +137,17 @@ final class WP_Style_Engine { ), ), ), + 'dimensions' => array( + 'minHeight' => array( + 'property_keys' => array( + 'default' => 'min-height', + ), + 'path' => array( 'dimensions', 'minHeight' ), + 'css_vars' => array( + 'spacing' => '--wp--preset--spacing--$slug', + ), + ), + ), 'spacing' => array( 'padding' => array( 'property_keys' => array( diff --git a/tests/phpunit/tests/block-supports/dimensions.php b/tests/phpunit/tests/block-supports/dimensions.php new file mode 100644 index 0000000000000..31ecfa9349803 --- /dev/null +++ b/tests/phpunit/tests/block-supports/dimensions.php @@ -0,0 +1,138 @@ +test_block_name = null; + } + + public function tear_down() { + unregister_block_type( $this->test_block_name ); + $this->test_block_name = null; + parent::tear_down(); + } + + public function test_dimensions_style_is_applied() { + $this->test_block_name = 'test/dimensions-style-is-applied'; + register_block_type( + $this->test_block_name, + array( + 'api_version' => 2, + 'attributes' => array( + 'style' => array( + 'type' => 'object', + ), + ), + 'supports' => array( + 'dimensions' => array( + 'minHeight' => true, + ), + ), + ) + ); + $registry = WP_Block_Type_Registry::get_instance(); + $block_type = $registry->get_registered( $this->test_block_name ); + $block_attrs = array( + 'style' => array( + 'dimensions' => array( + 'minHeight' => '50vh', + ), + ), + ); + + $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); + $expected = array( + 'style' => 'min-height:50vh;', + ); + + $this->assertSame( $expected, $actual ); + } + + public function test_dimensions_with_skipped_serialization_block_supports() { + $this->test_block_name = 'test/dimensions-with-skipped-serialization-block-supports'; + register_block_type( + $this->test_block_name, + array( + 'api_version' => 2, + 'attributes' => array( + 'style' => array( + 'type' => 'object', + ), + ), + 'supports' => array( + 'dimensions' => array( + 'minHeight' => true, + '__experimentalSkipSerialization' => true, + ), + ), + ) + ); + $registry = WP_Block_Type_Registry::get_instance(); + $block_type = $registry->get_registered( $this->test_block_name ); + $block_attrs = array( + 'style' => array( + 'dimensions' => array( + 'minHeight' => '50vh', + ), + ), + ); + + $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); + $expected = array(); + + $this->assertSame( $expected, $actual ); + } + + public function test_min_height_with_individual_skipped_serialization_block_supports() { + $this->test_block_name = 'test/min-height-with-individual-skipped-serialization-block-supports'; + register_block_type( + $this->test_block_name, + array( + 'api_version' => 2, + 'attributes' => array( + 'style' => array( + 'type' => 'object', + ), + ), + 'supports' => array( + 'dimensions' => array( + 'minHeight' => true, + '__experimentalSkipSerialization' => array( 'minHeight' ), + ), + ), + ) + ); + $registry = WP_Block_Type_Registry::get_instance(); + $block_type = $registry->get_registered( $this->test_block_name ); + $block_attrs = array( + 'style' => array( + 'dimensions' => array( + 'minHeight' => '50vh', + ), + ), + ); + + $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); + + /* + * There is currently only one dimensions property available, + * so the expected result is an empty array. This test exists + * so that as new properties are added, this test can be expanded + * to check that skipping individual serialization works as expected. + */ + $expected = array(); + + $this->assertSame( $expected, $actual ); + } +} diff --git a/tests/phpunit/tests/style-engine/styleEngine.php b/tests/phpunit/tests/style-engine/styleEngine.php index 7095140a436ce..616c332095eb0 100644 --- a/tests/phpunit/tests/style-engine/styleEngine.php +++ b/tests/phpunit/tests/style-engine/styleEngine.php @@ -166,6 +166,21 @@ public function data_wp_style_engine_get_styles() { ), ), + 'inline_valid_dimensions_style' => array( + 'block_styles' => array( + 'dimensions' => array( + 'minHeight' => '50vh', + ), + ), + 'options' => null, + 'expected_output' => array( + 'css' => 'min-height:50vh;', + 'declarations' => array( + 'min-height' => '50vh', + ), + ), + ), + 'inline_valid_typography_style' => array( 'block_styles' => array( 'typography' => array( From c2bb6cd90799d233fe299d3740260b2ef8b5bfe6 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:37:40 +1100 Subject: [PATCH 02/13] Fix failing tests --- tests/phpunit/tests/theme/wpThemeJson.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php index 3f174b5d05cbe..e4f690e918984 100644 --- a/tests/phpunit/tests/theme/wpThemeJson.php +++ b/tests/phpunit/tests/theme/wpThemeJson.php @@ -241,6 +241,9 @@ public function test_get_settings_appearance_true_opts_in() { 'color' => array( 'link' => true, ), + 'dimensions' => array( + 'minHeight' => true, + ), 'spacing' => array( 'blockGap' => false, 'margin' => true, @@ -265,6 +268,9 @@ public function test_get_settings_appearance_true_opts_in() { 'color' => array( 'link' => true, ), + 'dimensions' => array( + 'minHeight' => true + ), 'spacing' => array( 'blockGap' => false, 'margin' => true, From c3be8804bdd56412f56e80aa9f4b670a10675dc5 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:43:00 +1100 Subject: [PATCH 03/13] Fix linting issue --- tests/phpunit/tests/theme/wpThemeJson.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php index e4f690e918984..303af3853be47 100644 --- a/tests/phpunit/tests/theme/wpThemeJson.php +++ b/tests/phpunit/tests/theme/wpThemeJson.php @@ -269,7 +269,7 @@ public function test_get_settings_appearance_true_opts_in() { 'link' => true, ), 'dimensions' => array( - 'minHeight' => true + 'minHeight' => true, ), 'spacing' => array( 'blockGap' => false, From df4d498044653deea1340d99b114456439c173fd Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:58:48 +1100 Subject: [PATCH 04/13] Add missing line --- src/wp-includes/block-supports/dimensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/block-supports/dimensions.php b/src/wp-includes/block-supports/dimensions.php index 31e25e11454f0..7951f8d881a89 100644 --- a/src/wp-includes/block-supports/dimensions.php +++ b/src/wp-includes/block-supports/dimensions.php @@ -55,7 +55,7 @@ function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpc return array(); } - $styles = array(); + $attributes = array(); // Width support to be added in near future. From e79718fa675db4c154b14bff6822a1dec16e05fd Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:41:43 +1100 Subject: [PATCH 05/13] Add full stop to comment Co-authored-by: Mukesh Panchal --- src/wp-includes/class-wp-theme-json.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 2a4798d2d032b..d607246f2723e 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -498,7 +498,7 @@ public static function get_element_class_name( $element ) { * Options that settings.appearanceTools enables. * * @since 6.0.0 - * @since 6.2.0 Added `dimensions.minHeight` + * @since 6.2.0 Added `dimensions.minHeight`. * @var array */ const APPEARANCE_TOOLS_OPT_INS = array( From 6b1b594c5c27be54f7e2f78317d4a8179b489458 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 31 Jan 2023 16:44:30 +1100 Subject: [PATCH 06/13] Simplify tests --- .../tests/block-supports/dimensions.php | 116 +++++++----------- 1 file changed, 41 insertions(+), 75 deletions(-) diff --git a/tests/phpunit/tests/block-supports/dimensions.php b/tests/phpunit/tests/block-supports/dimensions.php index 31ecfa9349803..35789f249af80 100644 --- a/tests/phpunit/tests/block-supports/dimensions.php +++ b/tests/phpunit/tests/block-supports/dimensions.php @@ -23,8 +23,21 @@ public function tear_down() { parent::tear_down(); } - public function test_dimensions_style_is_applied() { - $this->test_block_name = 'test/dimensions-style-is-applied'; + /** + * Tests that minimum height block support works as expected. + * + * @ticket 57582 + * + * @covers ::wp_apply_dimensions_support + * + * @dataProvider data_minimum_height_block_support + * + * @param string $block_name The test block name to register. + * @param mixed $dimensions The dimensions block support settings. + * @param mixed $expected An expected return value. + */ + public function test_minimum_height_block_support( $block_name, $dimensions, $expected ) { + $this->test_block_name = $block_name; register_block_type( $this->test_block_name, array( @@ -35,9 +48,7 @@ public function test_dimensions_style_is_applied() { ), ), 'supports' => array( - 'dimensions' => array( - 'minHeight' => true, - ), + 'dimensions' => $dimensions, ), ) ); @@ -51,88 +62,43 @@ public function test_dimensions_style_is_applied() { ), ); - $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); - $expected = array( - 'style' => 'min-height:50vh;', - ); + $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); $this->assertSame( $expected, $actual ); } - public function test_dimensions_with_skipped_serialization_block_supports() { - $this->test_block_name = 'test/dimensions-with-skipped-serialization-block-supports'; - register_block_type( - $this->test_block_name, - array( - 'api_version' => 2, - 'attributes' => array( - 'style' => array( - 'type' => 'object', - ), + /** + * Data provider for test_minimum_height_block_support(). + * + * @return array + */ + public function data_minimum_height_block_support() { + return array( + 'style is applied' => array( + 'block_name' => 'test/dimensions-block-supports', + 'dimensions' => array( + 'minHeight' => true, ), - 'supports' => array( - 'dimensions' => array( - 'minHeight' => true, - '__experimentalSkipSerialization' => true, - ), + 'expected' => array( + 'style' => 'min-height:50vh;', ), - ) - ); - $registry = WP_Block_Type_Registry::get_instance(); - $block_type = $registry->get_registered( $this->test_block_name ); - $block_attrs = array( - 'style' => array( + ), + 'style output is skipped when serialization is skipped' => array( + 'block_name' => 'test/dimensions-with-skipped-serialization-block-supports', 'dimensions' => array( - 'minHeight' => '50vh', + 'minHeight' => true, + '__experimentalSkipSerialization' => true, ), + 'expected' => array(), ), - ); - - $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); - $expected = array(); - - $this->assertSame( $expected, $actual ); - } - - public function test_min_height_with_individual_skipped_serialization_block_supports() { - $this->test_block_name = 'test/min-height-with-individual-skipped-serialization-block-supports'; - register_block_type( - $this->test_block_name, - array( - 'api_version' => 2, - 'attributes' => array( - 'style' => array( - 'type' => 'object', - ), - ), - 'supports' => array( - 'dimensions' => array( - 'minHeight' => true, - '__experimentalSkipSerialization' => array( 'minHeight' ), - ), - ), - ) - ); - $registry = WP_Block_Type_Registry::get_instance(); - $block_type = $registry->get_registered( $this->test_block_name ); - $block_attrs = array( - 'style' => array( + 'style output is skipped when individual feature serialization is skipped' => array( + 'block_name' => 'test/min-height-with-individual-skipped-serialization-block-supports', 'dimensions' => array( - 'minHeight' => '50vh', + 'minHeight' => true, + '__experimentalSkipSerialization' => array( 'minHeight' ), ), + 'expected' => array(), ), ); - - $actual = wp_apply_dimensions_support( $block_type, $block_attrs ); - - /* - * There is currently only one dimensions property available, - * so the expected result is an empty array. This test exists - * so that as new properties are added, this test can be expanded - * to check that skipping individual serialization works as expected. - */ - $expected = array(); - - $this->assertSame( $expected, $actual ); } } From 19fa05e475765d0a76c7c6fc13051857c0177fe8 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 31 Jan 2023 16:53:03 +1100 Subject: [PATCH 07/13] Fix linting issue --- tests/phpunit/tests/block-supports/dimensions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/block-supports/dimensions.php b/tests/phpunit/tests/block-supports/dimensions.php index 35789f249af80..913e1e31791d8 100644 --- a/tests/phpunit/tests/block-supports/dimensions.php +++ b/tests/phpunit/tests/block-supports/dimensions.php @@ -74,22 +74,22 @@ public function test_minimum_height_block_support( $block_name, $dimensions, $ex */ public function data_minimum_height_block_support() { return array( - 'style is applied' => array( + 'style is applied' => array( 'block_name' => 'test/dimensions-block-supports', 'dimensions' => array( 'minHeight' => true, ), 'expected' => array( - 'style' => 'min-height:50vh;', + 'style' => 'min-height:50vh;', ), ), - 'style output is skipped when serialization is skipped' => array( + 'style output is skipped when serialization is skipped' => array( 'block_name' => 'test/dimensions-with-skipped-serialization-block-supports', 'dimensions' => array( 'minHeight' => true, '__experimentalSkipSerialization' => true, ), - 'expected' => array(), + 'expected' => array(), ), 'style output is skipped when individual feature serialization is skipped' => array( 'block_name' => 'test/min-height-with-individual-skipped-serialization-block-supports', @@ -97,7 +97,7 @@ public function data_minimum_height_block_support() { 'minHeight' => true, '__experimentalSkipSerialization' => array( 'minHeight' ), ), - 'expected' => array(), + 'expected' => array(), ), ); } From 432be9138ba1680ee03b0120968829413b7a12b6 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:06:34 +1100 Subject: [PATCH 08/13] Empty commit to rerun tests From 69e218ff6f68ff59c8b6aac8d360e7b37ce54d76 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 1 Feb 2023 13:44:19 +1100 Subject: [PATCH 09/13] Update data provider docblock. Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> --- tests/phpunit/tests/block-supports/dimensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/block-supports/dimensions.php b/tests/phpunit/tests/block-supports/dimensions.php index 913e1e31791d8..e8f1148818159 100644 --- a/tests/phpunit/tests/block-supports/dimensions.php +++ b/tests/phpunit/tests/block-supports/dimensions.php @@ -68,7 +68,7 @@ public function test_minimum_height_block_support( $block_name, $dimensions, $ex } /** - * Data provider for test_minimum_height_block_support(). + * Data provider. * * @return array */ From adb55ca43dfe24c0bb7dfa8c8f121ab998fc438c Mon Sep 17 00:00:00 2001 From: hellofromtonya Date: Wed, 1 Feb 2023 09:02:25 -0600 Subject: [PATCH 10/13] Renames test file for coding standard --- .../{dimensions.php => wpApplyDimensionsSupport.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/phpunit/tests/block-supports/{dimensions.php => wpApplyDimensionsSupport.php} (100%) diff --git a/tests/phpunit/tests/block-supports/dimensions.php b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php similarity index 100% rename from tests/phpunit/tests/block-supports/dimensions.php rename to tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php From cf7963951b4eaf5c5968fc8339552d8fc6706455 Mon Sep 17 00:00:00 2001 From: hellofromtonya Date: Wed, 1 Feb 2023 09:07:47 -0600 Subject: [PATCH 11/13] Rename test class to coding standards --- tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php index e8f1148818159..240e84e340dbf 100644 --- a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php +++ b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php @@ -6,7 +6,7 @@ * @covers ::wp_apply_dimensions_support */ -class WP_Block_Supports_Dimensions_Test extends WP_UnitTestCase { +class Tests_Block_Supports_wpApplyDimensionsSupport extends WP_UnitTestCase { /** * @var string|null */ From 811495eec6d32b0702165642067b2b29b73578ab Mon Sep 17 00:00:00 2001 From: hellofromtonya Date: Wed, 1 Feb 2023 09:09:33 -0600 Subject: [PATCH 12/13] Minor formatting in tests --- .../tests/block-supports/wpApplyDimensionsSupport.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php index 240e84e340dbf..b7082595aff45 100644 --- a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php +++ b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php @@ -5,7 +5,6 @@ * * @covers ::wp_apply_dimensions_support */ - class Tests_Block_Supports_wpApplyDimensionsSupport extends WP_UnitTestCase { /** * @var string|null @@ -33,8 +32,8 @@ public function tear_down() { * @dataProvider data_minimum_height_block_support * * @param string $block_name The test block name to register. - * @param mixed $dimensions The dimensions block support settings. - * @param mixed $expected An expected return value. + * @param mixed $dimensions The dimensions block support settings. + * @param mixed $expected The expected results. */ public function test_minimum_height_block_support( $block_name, $dimensions, $expected ) { $this->test_block_name = $block_name; From 12cebb4cd4239b4d9c06a05c20ccd2c21b5f55fb Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Wed, 1 Feb 2023 09:28:59 -0600 Subject: [PATCH 13/13] Capitalize 1st letter of function name --- tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php index b7082595aff45..a4f2973a06934 100644 --- a/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php +++ b/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php @@ -5,7 +5,7 @@ * * @covers ::wp_apply_dimensions_support */ -class Tests_Block_Supports_wpApplyDimensionsSupport extends WP_UnitTestCase { +class Tests_Block_Supports_WpApplyDimensionsSupport extends WP_UnitTestCase { /** * @var string|null */