@@ -272,31 +272,41 @@ public function test_using_symbols_in_block_bindings_value() {
272
272
}
273
273
274
274
/**
275
- * Tests if the `__default` attribute is replaced with real attribues for
275
+ * Tests if the `__default` attribute is replaced with real attributes for
276
276
* pattern overrides.
277
277
*
278
278
* @ticket 61333
279
+ * @ticket 62069
279
280
*
280
281
* @covers WP_Block::process_block_bindings
281
282
*/
282
283
public function test_default_binding_for_pattern_overrides () {
283
- $ expected_content = 'This is the content value ' ;
284
-
285
284
$ block_content = <<<HTML
286
285
<!-- wp:paragraph {"metadata":{"bindings":{"__default":{"source":"core/pattern-overrides"}},"name":"Test"}} -->
287
286
<p>This should not appear</p>
288
287
<!-- /wp:paragraph -->
289
288
HTML ;
290
289
291
- $ parsed_blocks = parse_blocks ( $ block_content );
292
- $ block = new WP_Block ( $ parsed_blocks [0 ], array ( 'pattern/overrides ' => array ( 'Test ' => array ( 'content ' => $ expected_content ) ) ) );
293
- $ result = $ block ->render ();
290
+ $ expected_content = 'This is the content value ' ;
291
+ $ parsed_blocks = parse_blocks ( $ block_content );
292
+ $ block = new WP_Block ( $ parsed_blocks [0 ], array ( 'pattern/overrides ' => array ( 'Test ' => array ( 'content ' => $ expected_content ) ) ) );
293
+
294
+ $ result = $ block ->render ();
294
295
295
296
$ this ->assertSame (
296
297
"<p> $ expected_content</p> " ,
297
298
trim ( $ result ),
298
299
'The `__default` attribute should be replaced with the real attribute prior to the callback. '
299
300
);
301
+
302
+ $ expected_bindings_metadata = array (
303
+ 'content ' => array ( 'source ' => 'core/pattern-overrides ' ),
304
+ );
305
+ $ this ->assertSame (
306
+ $ expected_bindings_metadata ,
307
+ $ block ->attributes ['metadata ' ]['bindings ' ],
308
+ 'The __default binding should be updated with the individual binding attributes in the block metadata. '
309
+ );
300
310
}
301
311
302
312
/**
0 commit comments