diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php
index 7e0c391e1f..4effe80ad8 100644
--- a/tests/phpunit/tests/blocks/register.php
+++ b/tests/phpunit/tests/blocks/register.php
@@ -876,6 +876,47 @@ class Tests_Blocks_Register extends WP_UnitTestCase {
 		$this->assertSameSets( array( 'alert', 'message' ), $result->keywords, 'The block keywords are incorrect' );
 	}
 
+	/**
+	 * Tests registering a block with a 'style' attribute using arguments instead of block.json.
+	 *
+	 * @ticket XXXXX
+	 *
+	 * @covers ::register_block_type_from_metadata
+	 */
+	public function test_register_block_type_from_metadata_with_style_attribute() {
+		$warnings = [];
+		set_error_handler(
+			function( $errno, $errstr ) use ( &$warnings ) {
+				$warnings[] = $errstr;
+			},
+			E_WARNING
+		);
+
+		$result = register_block_type_from_metadata(
+			'',
+			array(
+				'api_version' => 2,
+				'name'        => 'tests/notice-with-style',
+				'title'       => 'Notice with style',
+				'category'    => 'common',
+				'icon'        => 'star',
+				'description' => 'Test block with style attribute',
+				'keywords'    => array('test', 'style'),
+				'textdomain'  => 'notice-with-style',
+				'style'       => array('wc-blocks-style', 'wc-blocks-style-active-filters'),
+			)
+		);
+
+		// Restore normal error handling
+		restore_error_handler();
+
+		// Assert that the block was registered successfully
+		$this->assertInstanceOf( 'WP_Block_Type', $result, 'The block was not registered' );
+
+		// Check for any warnings
+		$this->assertEmpty( $warnings, 'Unexpected warnings were generated during block registration' );
+	}
+
 	/**
 	 * Tests that defined $args can properly override the block.json file.
 	 *
