| | 475 | /** |
| | 476 | * @ticket BP7202 |
| | 477 | */ |
| | 478 | public function test_relation_and_with_compare_not_in() { |
| | 479 | $this->create_fields( 1 ); |
| | 480 | $this->create_users( 4 ); |
| | 481 | |
| | 482 | xprofile_set_field_data( $this->fields[0], $this->users[0], 'boo' ); |
| | 483 | xprofile_set_field_data( $this->fields[0], $this->users[3], 'far' ); |
| | 484 | xprofile_set_field_data( $this->fields[0], $this->users[1], 'foo' ); |
| | 485 | xprofile_set_field_data( $this->fields[0], $this->users[2], 'bar' ); |
| | 486 | |
| | 487 | $q = new BP_User_Query( array( |
| | 488 | 'xprofile_query' => array( |
| | 489 | 'relation' => 'AND', |
| | 490 | array( |
| | 491 | 'field' => $this->fields[0], |
| | 492 | 'compare' => 'NOT IN', |
| | 493 | 'value' => array( 'foo', 'bar' ) |
| | 494 | ), |
| | 495 | array( |
| | 496 | 'field' => $this->fields[0], |
| | 497 | 'compare' => '!=', |
| | 498 | 'value' => 'far', |
| | 499 | ), |
| | 500 | ), |
| | 501 | ) ); |
| | 502 | |
| | 503 | $expected = array( $this->users[0] ); |
| | 504 | $this->assertEqualSets( $expected, array_keys( $q->results ) ); |
| | 505 | } |
| | 506 | |