| @@ 1286-1302 (lines=17) @@ | ||
| 1283 | ); |
|
| 1284 | } |
|
| 1285 | ||
| 1286 | public function testFieldRelationFilterContainsArray() |
|
| 1287 | { |
|
| 1288 | $this->assertSearchResults( |
|
| 1289 | array(69), |
|
| 1290 | $this->getContentSearchHandler()->findLocations( |
|
| 1291 | new LocationQuery( |
|
| 1292 | array( |
|
| 1293 | 'filter' => new Criterion\FieldRelation( |
|
| 1294 | 'billboard', |
|
| 1295 | Criterion\Operator::CONTAINS, |
|
| 1296 | array(60, 75) |
|
| 1297 | ), |
|
| 1298 | ) |
|
| 1299 | ) |
|
| 1300 | ) |
|
| 1301 | ); |
|
| 1302 | } |
|
| 1303 | ||
| 1304 | public function testFieldRelationFilterContainsArrayNotMatch() |
|
| 1305 | { |
|
| @@ 1322-1338 (lines=17) @@ | ||
| 1319 | ); |
|
| 1320 | } |
|
| 1321 | ||
| 1322 | public function testFieldRelationFilterInArray() |
|
| 1323 | { |
|
| 1324 | $this->assertSearchResults( |
|
| 1325 | array(69, 77), |
|
| 1326 | $this->getContentSearchHandler()->findLocations( |
|
| 1327 | new LocationQuery( |
|
| 1328 | array( |
|
| 1329 | 'filter' => new Criterion\FieldRelation( |
|
| 1330 | 'billboard', |
|
| 1331 | Criterion\Operator::IN, |
|
| 1332 | array(60, 64) |
|
| 1333 | ), |
|
| 1334 | ) |
|
| 1335 | ) |
|
| 1336 | ) |
|
| 1337 | ); |
|
| 1338 | } |
|
| 1339 | ||
| 1340 | public function testFieldRelationFilterInArrayNotMatch() |
|
| 1341 | { |
|
| @@ 1500-1520 (lines=21) @@ | ||
| 1497 | ); |
|
| 1498 | } |
|
| 1499 | ||
| 1500 | public function testIsMainLocationFilter() |
|
| 1501 | { |
|
| 1502 | $this->assertSearchResults( |
|
| 1503 | array(225), |
|
| 1504 | $this->getContentSearchHandler()->findLocations( |
|
| 1505 | new LocationQuery( |
|
| 1506 | array( |
|
| 1507 | 'filter' => new Criterion\LogicalAnd( |
|
| 1508 | array( |
|
| 1509 | new Criterion\ParentLocationId(224), |
|
| 1510 | new Criterion\Location\IsMainLocation( |
|
| 1511 | Criterion\Location\IsMainLocation::MAIN |
|
| 1512 | ), |
|
| 1513 | ) |
|
| 1514 | ), |
|
| 1515 | 'limit' => 10, |
|
| 1516 | ) |
|
| 1517 | ) |
|
| 1518 | ) |
|
| 1519 | ); |
|
| 1520 | } |
|
| 1521 | ||
| 1522 | public function testIsNotMainLocationFilter() |
|
| 1523 | { |
|
| @@ 1522-1542 (lines=21) @@ | ||
| 1519 | ); |
|
| 1520 | } |
|
| 1521 | ||
| 1522 | public function testIsNotMainLocationFilter() |
|
| 1523 | { |
|
| 1524 | $this->assertSearchResults( |
|
| 1525 | array(510), |
|
| 1526 | $this->getContentSearchHandler()->findLocations( |
|
| 1527 | new LocationQuery( |
|
| 1528 | array( |
|
| 1529 | 'filter' => new Criterion\LogicalAnd( |
|
| 1530 | array( |
|
| 1531 | new Criterion\ParentLocationId(224), |
|
| 1532 | new Criterion\Location\IsMainLocation( |
|
| 1533 | Criterion\Location\IsMainLocation::NOT_MAIN |
|
| 1534 | ), |
|
| 1535 | ) |
|
| 1536 | ), |
|
| 1537 | 'limit' => 10, |
|
| 1538 | ) |
|
| 1539 | ) |
|
| 1540 | ) |
|
| 1541 | ); |
|
| 1542 | } |
|
| 1543 | } |
|
| 1544 | ||