Changeset 58398 for trunk/tests/phpunit/tests/block-bindings/render.php
- Timestamp:
- 06/13/2024 08:55:47 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-bindings/render.php
r58289 r58398 237 237 238 238 /** 239 * Tests that including symbols and numbers works well with bound attributes. 240 * 241 * @ticket 61385 242 * 243 * @covers WP_Block::process_block_bindings 244 */ 245 public function test_using_symbols_in_block_bindings_value() { 246 $get_value_callback = function () { 247 return '$12.50'; 248 }; 249 250 register_block_bindings_source( 251 self::SOURCE_NAME, 252 array( 253 'label' => self::SOURCE_LABEL, 254 'get_value_callback' => $get_value_callback, 255 ) 256 ); 257 258 $block_content = <<<HTML 259 <!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"test/source"}}}} --> 260 <p>Default content</p> 261 <!-- /wp:paragraph --> 262 HTML; 263 $parsed_blocks = parse_blocks( $block_content ); 264 $block = new WP_Block( $parsed_blocks[0] ); 265 $result = $block->render(); 266 267 $this->assertSame( 268 '<p>$12.50</p>', 269 trim( $result ), 270 'The block content should properly show the symbol and numbers.' 271 ); 272 } 273 274 /** 239 275 * Tests if the `__default` attribute is replaced with real attribues for 240 276 * pattern overrides.
Note: See TracChangeset
for help on using the changeset viewer.