Changeset 58289 for trunk/tests/phpunit/tests/block-bindings/render.php
- Timestamp:
- 06/03/2024 07:42:57 AM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-bindings/render.php
r57754 r58289 235 235 ); 236 236 } 237 238 /** 239 * Tests if the `__default` attribute is replaced with real attribues for 240 * pattern overrides. 241 * 242 * @ticket 61333 243 * 244 * @covers WP_Block::process_block_bindings 245 */ 246 public function test_default_binding_for_pattern_overrides() { 247 $expected_content = 'This is the content value'; 248 249 $block_content = <<<HTML 250 <!-- wp:paragraph {"metadata":{"bindings":{"__default":{"source":"core/pattern-overrides"}},"name":"Test"}} --> 251 <p>This should not appear</p> 252 <!-- /wp:paragraph --> 253 HTML; 254 255 $parsed_blocks = parse_blocks( $block_content ); 256 $block = new WP_Block( $parsed_blocks[0], array( 'pattern/overrides' => array( 'Test' => array( 'content' => $expected_content ) ) ) ); 257 $result = $block->render(); 258 259 $this->assertSame( 260 "<p>$expected_content</p>", 261 trim( $result ), 262 'The `__default` attribute should be replaced with the real attribute prior to the callback.' 263 ); 264 } 237 265 }
Note: See TracChangeset
for help on using the changeset viewer.