Changeset 30094 for trunk/tests/phpunit/tests/user/query.php
- Timestamp:
- 10/29/2014 09:40:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/query.php
r30017 r30094 222 222 $this->assertEquals( $_query_vars, $query->query_vars ); 223 223 } 224 225 /** 226 * @ticket 23849 227 */ 228 function test_meta_query_with_role() { 229 $author_ids = $this->factory->user->create_many( 4, array( 'role' => 'author' ) ); 230 231 add_user_meta( $author_ids[0], 'foo', 'bar' ); 232 add_user_meta( $author_ids[1], 'foo', 'baz' ); 233 234 // Users with foo = bar or baz restricted to the author role. 235 $query = new WP_User_Query( array( 236 'fields' => '', 237 'role' => 'author', 238 'meta_query' => array( 239 'relation' => 'OR', 240 array( 241 'key' => 'foo', 242 'value' => 'bar', 243 ), 244 array( 245 'key' => 'foo', 246 'value' => 'baz', 247 ), 248 ), 249 ) ); 250 251 $this->assertEquals( array( $author_ids[0], $author_ids[1] ), $query->get_results() ); 252 } 224 253 }
Note: See TracChangeset
for help on using the changeset viewer.