| @@ 1293-1309 (lines=17) @@ | ||
| 1290 | ); |
|
| 1291 | } |
|
| 1292 | ||
| 1293 | public function testFieldRelationFilterContainsArray() |
|
| 1294 | { |
|
| 1295 | $this->assertSearchResults( |
|
| 1296 | array(69), |
|
| 1297 | $this->getContentSearchHandler()->findLocations( |
|
| 1298 | new LocationQuery( |
|
| 1299 | array( |
|
| 1300 | 'filter' => new Criterion\FieldRelation( |
|
| 1301 | 'billboard', |
|
| 1302 | Criterion\Operator::CONTAINS, |
|
| 1303 | array(60, 75) |
|
| 1304 | ), |
|
| 1305 | ) |
|
| 1306 | ) |
|
| 1307 | ) |
|
| 1308 | ); |
|
| 1309 | } |
|
| 1310 | ||
| 1311 | public function testFieldRelationFilterContainsArrayNotMatch() |
|
| 1312 | { |
|
| @@ 1329-1345 (lines=17) @@ | ||
| 1326 | ); |
|
| 1327 | } |
|
| 1328 | ||
| 1329 | public function testFieldRelationFilterInArray() |
|
| 1330 | { |
|
| 1331 | $this->assertSearchResults( |
|
| 1332 | array(69, 77), |
|
| 1333 | $this->getContentSearchHandler()->findLocations( |
|
| 1334 | new LocationQuery( |
|
| 1335 | array( |
|
| 1336 | 'filter' => new Criterion\FieldRelation( |
|
| 1337 | 'billboard', |
|
| 1338 | Criterion\Operator::IN, |
|
| 1339 | array(60, 64) |
|
| 1340 | ), |
|
| 1341 | ) |
|
| 1342 | ) |
|
| 1343 | ) |
|
| 1344 | ); |
|
| 1345 | } |
|
| 1346 | ||
| 1347 | public function testFieldRelationFilterInArrayNotMatch() |
|
| 1348 | { |
|
| @@ 1507-1527 (lines=21) @@ | ||
| 1504 | ); |
|
| 1505 | } |
|
| 1506 | ||
| 1507 | public function testIsMainLocationFilter() |
|
| 1508 | { |
|
| 1509 | $this->assertSearchResults( |
|
| 1510 | array(225), |
|
| 1511 | $this->getContentSearchHandler()->findLocations( |
|
| 1512 | new LocationQuery( |
|
| 1513 | array( |
|
| 1514 | 'filter' => new Criterion\LogicalAnd( |
|
| 1515 | array( |
|
| 1516 | new Criterion\ParentLocationId(224), |
|
| 1517 | new Criterion\Location\IsMainLocation( |
|
| 1518 | Criterion\Location\IsMainLocation::MAIN |
|
| 1519 | ), |
|
| 1520 | ) |
|
| 1521 | ), |
|
| 1522 | 'limit' => 10, |
|
| 1523 | ) |
|
| 1524 | ) |
|
| 1525 | ) |
|
| 1526 | ); |
|
| 1527 | } |
|
| 1528 | ||
| 1529 | public function testIsNotMainLocationFilter() |
|
| 1530 | { |
|
| @@ 1529-1549 (lines=21) @@ | ||
| 1526 | ); |
|
| 1527 | } |
|
| 1528 | ||
| 1529 | public function testIsNotMainLocationFilter() |
|
| 1530 | { |
|
| 1531 | $this->assertSearchResults( |
|
| 1532 | array(510), |
|
| 1533 | $this->getContentSearchHandler()->findLocations( |
|
| 1534 | new LocationQuery( |
|
| 1535 | array( |
|
| 1536 | 'filter' => new Criterion\LogicalAnd( |
|
| 1537 | array( |
|
| 1538 | new Criterion\ParentLocationId(224), |
|
| 1539 | new Criterion\Location\IsMainLocation( |
|
| 1540 | Criterion\Location\IsMainLocation::NOT_MAIN |
|
| 1541 | ), |
|
| 1542 | ) |
|
| 1543 | ), |
|
| 1544 | 'limit' => 10, |
|
| 1545 | ) |
|
| 1546 | ) |
|
| 1547 | ) |
|
| 1548 | ); |
|
| 1549 | } |
|
| 1550 | } |
|
| 1551 | ||