From 26afbdecfe1faf5a9bab19f7b7d2c841ac21c86c Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 16 Nov 2018 16:36:23 -0500 Subject: [PATCH] REST API: Update block renderer test to omit undefined defaults --- phpunit/class-rest-block-renderer-controller-test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpunit/class-rest-block-renderer-controller-test.php b/phpunit/class-rest-block-renderer-controller-test.php index 66191e122ededb..3691c4d162af4f 100644 --- a/phpunit/class-rest-block-renderer-controller-test.php +++ b/phpunit/class-rest-block-renderer-controller-test.php @@ -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 );