User query `meta_vars` test must account for the 'blog_id' clause added in multisite.

See #31265.

git-svn-id: https://develop.svn.wordpress.org/trunk@31668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2015-03-07 17:33:48 +00:00
parent 6bb478d3fd
commit 6a4839bd83
1 changed files with 12 additions and 4 deletions

View File

@ -362,10 +362,18 @@ class Tests_User_Query extends WP_UnitTestCase {
'meta_type' => 'SIGNED',
) );
$this->assertSame( 'foo', $q->meta_query->queries[0]['key'] );
$this->assertSame( '5', $q->meta_query->queries[0]['value'] );
$this->assertSame( '>', $q->meta_query->queries[0]['compare'] );
$this->assertSame( 'SIGNED', $q->meta_query->queries[0]['type'] );
// Multisite adds a 'blog_id' clause, so we have to find the 'foo' clause.
$mq_clauses = $q->meta_query->get_clauses();
foreach ( $mq_clauses as $mq_clause ) {
if ( 'foo' === $mq_clause['key'] ) {
$clause = $mq_clause;
}
}
$this->assertSame( 'foo', $clause['key'] );
$this->assertSame( '5', $clause['value'] );
$this->assertSame( '>', $clause['compare'] );
$this->assertSame( 'SIGNED', $clause['type'] );
}
/**