| @@ 389-411 (lines=23) @@ | ||
| 386 | ); |
|
| 387 | } |
|
| 388 | ||
| 389 | public function testLocationIdAndCombinatorFilter() |
|
| 390 | { |
|
| 391 | $this->assertSearchResults( |
|
| 392 | [13], |
|
| 393 | $this->getContentSearchHandler()->findLocations( |
|
| 394 | new LocationQuery( |
|
| 395 | [ |
|
| 396 | 'filter' => new Criterion\LogicalAnd( |
|
| 397 | [ |
|
| 398 | new Criterion\LocationId( |
|
| 399 | [4, 12, 13] |
|
| 400 | ), |
|
| 401 | new Criterion\LocationId( |
|
| 402 | [13, 44] |
|
| 403 | ), |
|
| 404 | ] |
|
| 405 | ), |
|
| 406 | 'limit' => 10, |
|
| 407 | ] |
|
| 408 | ) |
|
| 409 | ) |
|
| 410 | ); |
|
| 411 | } |
|
| 412 | ||
| 413 | public function testLocationIdParentLocationIdAndCombinatorFilter() |
|
| 414 | { |
|
| @@ 576-592 (lines=17) @@ | ||
| 573 | ); |
|
| 574 | } |
|
| 575 | ||
| 576 | public function testVisibilityFilterVisible() |
|
| 577 | { |
|
| 578 | $this->assertSearchResults( |
|
| 579 | [2, 5, 12, 13, 14], |
|
| 580 | $this->getContentSearchHandler()->findLocations( |
|
| 581 | new LocationQuery( |
|
| 582 | [ |
|
| 583 | 'filter' => new Criterion\Visibility( |
|
| 584 | Criterion\Visibility::VISIBLE |
|
| 585 | ), |
|
| 586 | 'limit' => 5, |
|
| 587 | 'sortClauses' => [new SortClause\Location\Id()], |
|
| 588 | ] |
|
| 589 | ) |
|
| 590 | ) |
|
| 591 | ); |
|
| 592 | } |
|
| 593 | ||
| 594 | public function testVisibilityFilterHidden() |
|
| 595 | { |
|
| @@ 720-734 (lines=15) @@ | ||
| 717 | ); |
|
| 718 | } |
|
| 719 | ||
| 720 | public function testContentTypeIdentifierFilter() |
|
| 721 | { |
|
| 722 | $this->assertSearchResults( |
|
| 723 | [43, 48, 51, 52, 53], |
|
| 724 | $this->getContentSearchHandler()->findLocations( |
|
| 725 | new LocationQuery( |
|
| 726 | [ |
|
| 727 | 'filter' => new Criterion\ContentTypeIdentifier('folder'), |
|
| 728 | 'limit' => 5, |
|
| 729 | 'sortClauses' => [new SortClause\Location\Id()], |
|
| 730 | ] |
|
| 731 | ) |
|
| 732 | ) |
|
| 733 | ); |
|
| 734 | } |
|
| 735 | ||
| 736 | public function testObjectStateIdFilter() |
|
| 737 | { |
|
| @@ 838-855 (lines=18) @@ | ||
| 835 | ); |
|
| 836 | } |
|
| 837 | ||
| 838 | public function testDateMetadataFilterModifiedIn() |
|
| 839 | { |
|
| 840 | $this->assertSearchResults( |
|
| 841 | [12, 15, 227, 228], |
|
| 842 | $this->getContentSearchHandler()->findLocations( |
|
| 843 | new LocationQuery( |
|
| 844 | [ |
|
| 845 | 'filter' => new Criterion\DateMetadata( |
|
| 846 | Criterion\DateMetadata::MODIFIED, |
|
| 847 | Criterion\Operator::IN, |
|
| 848 | [1311154214, 1311154215] |
|
| 849 | ), |
|
| 850 | 'limit' => 10, |
|
| 851 | ] |
|
| 852 | ) |
|
| 853 | ) |
|
| 854 | ); |
|
| 855 | } |
|
| 856 | ||
| 857 | public function testDateMetadataFilterModifiedBetween() |
|
| 858 | { |
|
| @@ 857-874 (lines=18) @@ | ||
| 854 | ); |
|
| 855 | } |
|
| 856 | ||
| 857 | public function testDateMetadataFilterModifiedBetween() |
|
| 858 | { |
|
| 859 | $this->assertSearchResults( |
|
| 860 | [12, 15, 227, 228], |
|
| 861 | $this->getContentSearchHandler()->findLocations( |
|
| 862 | new LocationQuery( |
|
| 863 | [ |
|
| 864 | 'filter' => new Criterion\DateMetadata( |
|
| 865 | Criterion\DateMetadata::MODIFIED, |
|
| 866 | Criterion\Operator::BETWEEN, |
|
| 867 | [1311154213, 1311154215] |
|
| 868 | ), |
|
| 869 | 'limit' => 10, |
|
| 870 | ] |
|
| 871 | ) |
|
| 872 | ) |
|
| 873 | ); |
|
| 874 | } |
|
| 875 | ||
| 876 | public function testDateMetadataFilterCreatedBetween() |
|
| 877 | { |
|
| @@ 876-893 (lines=18) @@ | ||
| 873 | ); |
|
| 874 | } |
|
| 875 | ||
| 876 | public function testDateMetadataFilterCreatedBetween() |
|
| 877 | { |
|
| 878 | $this->assertSearchResults( |
|
| 879 | [68, 133, 227], |
|
| 880 | $this->getContentSearchHandler()->findLocations( |
|
| 881 | new LocationQuery( |
|
| 882 | [ |
|
| 883 | 'filter' => new Criterion\DateMetadata( |
|
| 884 | Criterion\DateMetadata::CREATED, |
|
| 885 | Criterion\Operator::BETWEEN, |
|
| 886 | [1299780749, 1311154215] |
|
| 887 | ), |
|
| 888 | 'limit' => 10, |
|
| 889 | ] |
|
| 890 | ) |
|
| 891 | ) |
|
| 892 | ); |
|
| 893 | } |
|
| 894 | ||
| 895 | public function testUserMetadataFilterOwnerWrongUserId() |
|
| 896 | { |
|
| @@ 1383-1400 (lines=18) @@ | ||
| 1380 | ); |
|
| 1381 | } |
|
| 1382 | ||
| 1383 | public function testFieldFilterIn() |
|
| 1384 | { |
|
| 1385 | $this->assertSearchResults( |
|
| 1386 | [12, 44], |
|
| 1387 | $this->getContentSearchHandler()->findLocations( |
|
| 1388 | new LocationQuery( |
|
| 1389 | [ |
|
| 1390 | 'filter' => new Criterion\Field( |
|
| 1391 | 'name', |
|
| 1392 | Criterion\Operator::IN, |
|
| 1393 | ['members', 'anonymous users'] |
|
| 1394 | ), |
|
| 1395 | 'limit' => 10, |
|
| 1396 | ] |
|
| 1397 | ) |
|
| 1398 | ) |
|
| 1399 | ); |
|
| 1400 | } |
|
| 1401 | ||
| 1402 | public function testFieldFilterContainsPartial() |
|
| 1403 | { |
|
| @@ 1459-1476 (lines=18) @@ | ||
| 1456 | ); |
|
| 1457 | } |
|
| 1458 | ||
| 1459 | public function testFieldFilterBetween() |
|
| 1460 | { |
|
| 1461 | $this->assertSearchResults( |
|
| 1462 | [71, 73, 74], |
|
| 1463 | $this->getContentSearchHandler()->findLocations( |
|
| 1464 | new LocationQuery( |
|
| 1465 | [ |
|
| 1466 | 'filter' => new Criterion\Field( |
|
| 1467 | 'price', |
|
| 1468 | Criterion\Operator::BETWEEN, |
|
| 1469 | [10000, 1000000] |
|
| 1470 | ), |
|
| 1471 | 'limit' => 10, |
|
| 1472 | ] |
|
| 1473 | ) |
|
| 1474 | ) |
|
| 1475 | ); |
|
| 1476 | } |
|
| 1477 | ||
| 1478 | public function testFieldFilterOr() |
|
| 1479 | { |
|