Changeset 51344 for trunk/tests/phpunit/tests/blocks/render-reusable.php
- Timestamp:
- 07/06/2021 02:36:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/render-reusable.php
r50382 r51344 101 101 } 102 102 103 /**104 * Throw a warning if blocks are recursively nested.105 *106 * @ticket 52364107 */108 public function test_recursive_render_warning() {109 $recursive_reusable_block = array(110 'ID' => self::$block_id,111 'post_content' => '<!-- wp:block {"ref":' . self::$block_id . '} /-->',112 );113 wp_update_post( $recursive_reusable_block );114 115 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( 'core/block' );116 117 // The block_render method for `core/block` triggers a user warning if it118 // encounters a recursively nested block.119 $this->expectException( 'PHPUnit_Framework_Error_Warning' );120 $block_type->render( array( 'ref' => self::$block_id ) );121 }122 123 103 public function test_ref_empty() { 124 104 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( 'core/block' );
Note: See TracChangeset
for help on using the changeset viewer.