|
@@ 269-279 (lines=11) @@
|
| 266 |
|
* |
| 267 |
|
* @covers Automattic\Jetpack\Blocks::jetpack_register_block |
| 268 |
|
*/ |
| 269 |
|
public function test_jetpack_register_block_with_editor_style() { |
| 270 |
|
add_filter( 'jetpack_is_standalone_block', '__return_false' ); |
| 271 |
|
try { |
| 272 |
|
$result = Blocks::jetpack_register_block( 'jetpack/block-with-editor-style' ); |
| 273 |
|
$this->assertEquals( 'jetpack/block-with-editor-style', $result->name ); |
| 274 |
|
$this->assertEquals( 'jetpack-blocks-editor', $result->editor_style ); |
| 275 |
|
} finally { |
| 276 |
|
remove_filter( 'jetpack_is_standalone_block', '__return_false' ); |
| 277 |
|
} |
| 278 |
|
|
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
/** |
| 282 |
|
* Test to ensure registering a Jetpack block does not override an existing dependency, |
|
@@ 289-303 (lines=15) @@
|
| 286 |
|
* |
| 287 |
|
* @covers Automattic\Jetpack\Blocks::jetpack_register_block |
| 288 |
|
*/ |
| 289 |
|
public function test_jetpack_register_block_with_existing_editor_style() { |
| 290 |
|
add_filter( 'jetpack_is_standalone_block', '__return_false' ); |
| 291 |
|
try { |
| 292 |
|
$result = Blocks::jetpack_register_block( |
| 293 |
|
'jetpack/block-with-existing-editor-style', |
| 294 |
|
array( |
| 295 |
|
'editor_style' => 'custom-editor-style', |
| 296 |
|
) |
| 297 |
|
); |
| 298 |
|
$this->assertEquals( 'jetpack/block-with-existing-editor-style', $result->name ); |
| 299 |
|
$this->assertEquals( 'custom-editor-style', $result->editor_style ); |
| 300 |
|
} finally { |
| 301 |
|
remove_filter( 'jetpack_is_standalone_block', '__return_false' ); |
| 302 |
|
} |
| 303 |
|
} |
| 304 |
|
} |
| 305 |
|
|