Skip to content

Commit

Permalink
REST API: Update block renderer test to omit undefined defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Nov 16, 2018
1 parent bc53c47 commit fab97d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phpunit/class-rest-block-renderer-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ public function test_get_item_default_attributes() {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( self::$block_name );
$defaults = array();
foreach ( $block_type->attributes as $key => $attribute ) {
$defaults[ $key ] = isset( $attribute['default'] ) ? $attribute['default'] : null;
if ( isset( $attribute['default'] ) ) {
$defaults[ $key ] = $attribute['default'];
}
}

$request = new WP_REST_Request( 'GET', self::$rest_api_route . self::$block_name );
Expand Down

0 comments on commit fab97d1

Please sign in to comment.