Skip to content

Commit

Permalink
Unit test no styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Apr 29, 2024
1 parent e5eb787 commit cf77710
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion phpunit/block-supports/background-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit cf77710

Please sign in to comment.