mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Build/Test Tools: Add unit test for non-existing block-styles registration.
Follow-up to [54155]. Props aristath, mukesh27. Fixes #56664. git-svn-id: https://develop.svn.wordpress.org/trunk@54472 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -374,6 +374,21 @@ class Tests_Blocks_Register extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 56664
|
||||
*/
|
||||
public function test_register_nonexistent_stylesheet() {
|
||||
$metadata = array(
|
||||
'file' => DIR_TESTDATA . '/blocks/notice/block.json',
|
||||
'name' => 'unit-tests/test-block-nonexistent-stylesheet',
|
||||
'style' => 'file:./nonexistent.css',
|
||||
);
|
||||
register_block_style_handle( $metadata, 'style' );
|
||||
|
||||
global $wp_styles;
|
||||
$this->assertFalse( $wp_styles->registered['unit-tests-test-block-nonexistent-stylesheet-style']->src );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 55513
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user