Changeset 48263 for trunk/tests/phpunit/tests/blocks/register.php
- Timestamp:
- 07/01/2020 01:08:11 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/register.php
r48141 r48263 381 381 $this->assertFalse( has_blocks( $content ) ); 382 382 } 383 384 /** 385 * @ticket 49615 386 */ 387 public function test_filter_block_registration() { 388 $filter_registration = function( $args, $name ) { 389 $args['attributes'] = array( $name => array( 'type' => 'boolean' ) ); 390 return $args; 391 }; 392 393 add_filter( 'register_block_type_args', $filter_registration, 10, 2 ); 394 register_block_type( 'core/test-filtered', array() ); 395 remove_filter( 'register_block_type_args', $filter_registration ); 396 397 $registry = WP_Block_Type_Registry::get_instance(); 398 $block_type = $registry->get_registered( 'core/test-filtered' ); 399 $this->assertEquals( 'boolean', $block_type->attributes['core/test-filtered']['type'] ); 400 } 383 401 }
Note: See TracChangeset
for help on using the changeset viewer.