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