Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a missing test for register_block
  • Loading branch information
nylen committed May 9, 2017
commit 44c4f5a0be3a5d049fb98e0a8bfb9e5b8505f026
13 changes: 13 additions & 0 deletions phpunit/class-registration-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ function test_register_block() {
$this->assertEquals( $updated_settings, $wp_registered_blocks['core/text'] );
}

/**
* Should fail to re-register the same block
*
* @expectedIncorrectUsage register_block
*/
function test_register_block_twice() {
$settings = array(
'icon' => 'text',
);
register_block( 'core/text', $settings );
register_block( 'core/text', $settings );
}

/**
* Unregistering should fail if a block is not registered
*
Expand Down