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