'blocks-page', 'title' => 'Checkout', 'content' => '
', ); $page_id = wc_create_page( $page['name'], '', $page['title'], $page['content'] ); $this->assertTrue( WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/checkout' ) ); $this->assertFalse( WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/cart' ) ); } /** * @group block-utils * Test: has_block_in_page. * */ public function test_has_block_in_page_on_page_with_no_blocks() { $page = array( 'name' => 'shortcode-page', 'title' => 'Checkout', 'content' => ' [woocommerce_checkout] ', ); $page_id = wc_create_page( $page['name'], '', $page['title'], $page['content'] ); $this->assertFalse( WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/checkout' ) ); $this->assertFalse( WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/cart' ) ); } /** * @group block-utils * Test: has_block_in_page. * */ public function test_has_block_in_page_on_page_with_multiple_blocks() { $page = array( 'name' => 'shortcode-page', 'title' => 'Checkout', 'content' => '