- Timestamp:
- 07/23/2014 05:56:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/class-bp-user-query.php
r8087 r8675 220 220 $this->assertEquals( $user_id, $found_user_id ); 221 221 } 222 223 public function test_bp_user_query_search_wildcards() { 224 $u1 = $this->create_user( array( 225 'user_login' => 'xfoo', 226 ) ); 227 xprofile_set_field_data( 1, $u1, "Bar" ); 228 $q1 = new BP_User_Query( array( 'search_terms' => 'foo', 'search_wildcard' => 'left' ) ); 229 230 $u2 = $this->create_user( array( 231 'user_login' => 'foox', 232 ) ); 233 xprofile_set_field_data( 1, $u2, "Bar" ); 234 $q2 = new BP_User_Query( array( 'search_terms' => 'foo', 'search_wildcard' => 'right' ) ); 235 236 $u3 = $this->create_user( array( 237 'user_login' => 'xfoox', 238 ) ); 239 xprofile_set_field_data( 1, $u3, "Bar" ); 240 $q3 = new BP_User_Query( array( 'search_terms' => 'foo', 'search_wildcard' => 'both' ) ); 241 242 $this->assertNotEmpty( $q1->results ); 243 $q1 = array_pop( $q1->results ); 244 $this->assertEquals( $u1, $q1->ID ); 245 246 $this->assertNotEmpty( $q2->results ); 247 $q2 = array_pop( $q2->results ); 248 $this->assertEquals( $u2, $q2->ID ); 249 250 $this->assertNotEmpty( $q3->results ); 251 foreach ( $q3->results as $user ) { 252 $this->assertTrue( in_array( $user->ID, array( $u1, $u2, $u3 ) ) ); 253 } 254 } 255 222 256 /** 223 257 * @group exclude
Note: See TracChangeset
for help on using the changeset viewer.