-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reusable Blocks: Preload user permissions (#15061)
* Reusable Blocks: Preload user permissions * Testing: Unskip block deletion test See #15059 (comment)
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Test `gutenberg_extend_block_editor_preload_paths`. | ||
* | ||
* @package Gutenberg | ||
*/ | ||
|
||
class Extend_Preload_Paths_Test extends WP_UnitTestCase { | ||
/** | ||
* Tests '/wp/v2/blocks' added if missing. | ||
*/ | ||
function test_localizes_script() { | ||
$preload_paths = gutenberg_extend_block_editor_preload_paths( array() ); | ||
|
||
$this->assertEquals( array( array( '/wp/v2/blocks', 'OPTIONS' ) ), $preload_paths ); | ||
} | ||
|
||
/** | ||
* Tests '/wp/v2/blocks' not added if present. | ||
*/ | ||
function test_replaces_registered_properties() { | ||
$preload_paths = gutenberg_extend_block_editor_preload_paths( array( array( '/wp/v2/blocks', 'OPTIONS' ) ) ); | ||
|
||
$this->assertEquals( array( array( '/wp/v2/blocks', 'OPTIONS' ) ), $preload_paths ); | ||
} | ||
} |