Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/phpunit/tests/query/taxQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1744,4 +1744,36 @@ public function test_hierarchical_taxonomies_do_not_limit_query() {
$this->assertSameSets( array( $p ), $q->posts );
$this->assertStringNotContainsString( 'LIMIT 1', $query );
}

/**
* @ticket 57300
*
* @covers WP_Query::parse_tax_query
*/
public function test_rewrite_hierarchical_array_query_param() {
register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true, 'rewrite' => array( 'hierarchical' => true ) ) );
$name = 'foobar';
$t = self::factory()->term->create(
array(
'taxonomy' => 'wptests_tax',
'name' => $name,
)
);

$q = new WP_Query(
array(
'fields' => 'ids',
'wptests_tax' => [$name],
'tax_query' => array(
array(
'taxonomy' => 'wptests_tax',
'field' => 'name',
'terms' => $name,
),
),
)
);
// If we got this far, no errors were thrown.
$this->expectNotToPerformAssertions();
}
}