| @@ 393-415 (lines=23) @@ | ||
| 390 | ); |
|
| 391 | } |
|
| 392 | ||
| 393 | public function testLocationIdAndCombinatorFilter() |
|
| 394 | { |
|
| 395 | $this->assertSearchResults( |
|
| 396 | array(13), |
|
| 397 | $this->getContentSearchHandler()->findLocations( |
|
| 398 | new LocationQuery( |
|
| 399 | array( |
|
| 400 | 'filter' => new Criterion\LogicalAnd( |
|
| 401 | array( |
|
| 402 | new Criterion\LocationId( |
|
| 403 | array(4, 12, 13) |
|
| 404 | ), |
|
| 405 | new Criterion\LocationId( |
|
| 406 | array(13, 44) |
|
| 407 | ), |
|
| 408 | ) |
|
| 409 | ), |
|
| 410 | 'limit' => 10, |
|
| 411 | ) |
|
| 412 | ) |
|
| 413 | ) |
|
| 414 | ); |
|
| 415 | } |
|
| 416 | ||
| 417 | public function testLocationIdParentLocationIdAndCombinatorFilter() |
|
| 418 | { |
|
| @@ 580-596 (lines=17) @@ | ||
| 577 | ); |
|
| 578 | } |
|
| 579 | ||
| 580 | public function testVisibilityFilterVisible() |
|
| 581 | { |
|
| 582 | $this->assertSearchResults( |
|
| 583 | array(2, 5, 12, 13, 14), |
|
| 584 | $this->getContentSearchHandler()->findLocations( |
|
| 585 | new LocationQuery( |
|
| 586 | array( |
|
| 587 | 'filter' => new Criterion\Visibility( |
|
| 588 | Criterion\Visibility::VISIBLE |
|
| 589 | ), |
|
| 590 | 'limit' => 5, |
|
| 591 | 'sortClauses' => array(new SortClause\Location\Id()), |
|
| 592 | ) |
|
| 593 | ) |
|
| 594 | ) |
|
| 595 | ); |
|
| 596 | } |
|
| 597 | ||
| 598 | public function testVisibilityFilterHidden() |
|
| 599 | { |
|
| @@ 724-738 (lines=15) @@ | ||
| 721 | ); |
|
| 722 | } |
|
| 723 | ||
| 724 | public function testContentTypeIdentifierFilter() |
|
| 725 | { |
|
| 726 | $this->assertSearchResults( |
|
| 727 | array(43, 48, 51, 52, 53), |
|
| 728 | $this->getContentSearchHandler()->findLocations( |
|
| 729 | new LocationQuery( |
|
| 730 | array( |
|
| 731 | 'filter' => new Criterion\ContentTypeIdentifier('folder'), |
|
| 732 | 'limit' => 5, |
|
| 733 | 'sortClauses' => array(new SortClause\Location\Id()), |
|
| 734 | ) |
|
| 735 | ) |
|
| 736 | ) |
|
| 737 | ); |
|
| 738 | } |
|
| 739 | ||
| 740 | public function testObjectStateIdFilter() |
|
| 741 | { |
|
| @@ 842-859 (lines=18) @@ | ||
| 839 | ); |
|
| 840 | } |
|
| 841 | ||
| 842 | public function testDateMetadataFilterModifiedIn() |
|
| 843 | { |
|
| 844 | $this->assertSearchResults( |
|
| 845 | array(12, 15, 227, 228), |
|
| 846 | $this->getContentSearchHandler()->findLocations( |
|
| 847 | new LocationQuery( |
|
| 848 | array( |
|
| 849 | 'filter' => new Criterion\DateMetadata( |
|
| 850 | Criterion\DateMetadata::MODIFIED, |
|
| 851 | Criterion\Operator::IN, |
|
| 852 | array(1311154214, 1311154215) |
|
| 853 | ), |
|
| 854 | 'limit' => 10, |
|
| 855 | ) |
|
| 856 | ) |
|
| 857 | ) |
|
| 858 | ); |
|
| 859 | } |
|
| 860 | ||
| 861 | public function testDateMetadataFilterModifiedBetween() |
|
| 862 | { |
|
| @@ 861-878 (lines=18) @@ | ||
| 858 | ); |
|
| 859 | } |
|
| 860 | ||
| 861 | public function testDateMetadataFilterModifiedBetween() |
|
| 862 | { |
|
| 863 | $this->assertSearchResults( |
|
| 864 | array(12, 15, 227, 228), |
|
| 865 | $this->getContentSearchHandler()->findLocations( |
|
| 866 | new LocationQuery( |
|
| 867 | array( |
|
| 868 | 'filter' => new Criterion\DateMetadata( |
|
| 869 | Criterion\DateMetadata::MODIFIED, |
|
| 870 | Criterion\Operator::BETWEEN, |
|
| 871 | array(1311154213, 1311154215) |
|
| 872 | ), |
|
| 873 | 'limit' => 10, |
|
| 874 | ) |
|
| 875 | ) |
|
| 876 | ) |
|
| 877 | ); |
|
| 878 | } |
|
| 879 | ||
| 880 | public function testDateMetadataFilterCreatedBetween() |
|
| 881 | { |
|
| @@ 880-897 (lines=18) @@ | ||
| 877 | ); |
|
| 878 | } |
|
| 879 | ||
| 880 | public function testDateMetadataFilterCreatedBetween() |
|
| 881 | { |
|
| 882 | $this->assertSearchResults( |
|
| 883 | array(68, 133, 227), |
|
| 884 | $this->getContentSearchHandler()->findLocations( |
|
| 885 | new LocationQuery( |
|
| 886 | array( |
|
| 887 | 'filter' => new Criterion\DateMetadata( |
|
| 888 | Criterion\DateMetadata::CREATED, |
|
| 889 | Criterion\Operator::BETWEEN, |
|
| 890 | array(1299780749, 1311154215) |
|
| 891 | ), |
|
| 892 | 'limit' => 10, |
|
| 893 | ) |
|
| 894 | ) |
|
| 895 | ) |
|
| 896 | ); |
|
| 897 | } |
|
| 898 | ||
| 899 | public function testUserMetadataFilterOwnerWrongUserId() |
|
| 900 | { |
|