From cf77710b946de0181a65fc2494f75a967f6a4b78 Mon Sep 17 00:00:00 2001 From: ramon Date: Mon, 15 Apr 2024 11:46:45 +1000 Subject: [PATCH] Unit test no styles --- phpunit/block-supports/background-test.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpunit/block-supports/background-test.php b/phpunit/block-supports/background-test.php index c11531c7916722..78aa2cc56a672f 100644 --- a/phpunit/block-supports/background-test.php +++ b/phpunit/block-supports/background-test.php @@ -226,7 +226,7 @@ public function data_background_block_support() { */ public function test_get_background_support_styles( $background_style, $expected_css ) { switch_theme( 'block-theme' ); - $actual = gutenberg_get_background_support_styles( $background_style )['css']; + $actual = gutenberg_get_background_support_styles( $background_style )['css'] ?? null; $this->assertEquals( $expected_css, @@ -242,6 +242,12 @@ public function test_get_background_support_styles( $background_style, $expected */ public function data_get_background_support_styles() { return array( + 'no css generated with no block styles' => array( + 'background_style' => array( + 'backgroundImage' => array(), + ), + 'expected_css' => null, + ), 'css generated with theme background image path' => array( 'background_style' => array( 'backgroundImage' => array(