Changeset 59761 for trunk/tests/phpunit/tests/blocks/wpBlock.php
- Timestamp:
- 02/04/2025 08:59:04 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/wpBlock.php
r59116 r59761 716 716 717 717 /** 718 * @ticket 62901 719 */ 720 public function test_build_query_vars_from_query_block_with_top_level_parent() { 721 $this->registry->register( 722 'core/example', 723 array( 'uses_context' => array( 'query' ) ) 724 ); 725 726 $parsed_blocks = parse_blocks( '<!-- wp:example {"ok":true} -->a<!-- wp:example /-->b<!-- /wp:example -->' ); 727 $parsed_block = $parsed_blocks[0]; 728 $context = array( 729 'query' => array( 730 'postType' => 'page', 731 'parents' => array( 0 ), 732 ), 733 ); 734 $block = new WP_Block( $parsed_block, $context, $this->registry ); 735 $query = build_query_vars_from_query_block( $block, 1 ); 736 737 $this->assertSame( 738 array( 739 'post_type' => 'page', 740 'order' => 'DESC', 741 'orderby' => 'date', 742 'post__not_in' => array(), 743 'tax_query' => array(), 744 'post_parent__in' => array( 0 ), 745 ), 746 $query 747 ); 748 } 749 750 /** 718 751 * @ticket 56467 719 752 */
Note: See TracChangeset
for help on using the changeset viewer.