| @@ 308-330 (lines=23) @@ | ||
| 305 | ); |
|
| 306 | } |
|
| 307 | ||
| 308 | public function testLocationIdAndCombinatorFilter() |
|
| 309 | { |
|
| 310 | $this->assertSearchResults( |
|
| 311 | array(13), |
|
| 312 | $this->getContentSearchHandler()->findLocations( |
|
| 313 | new LocationQuery( |
|
| 314 | array( |
|
| 315 | 'filter' => new Criterion\LogicalAnd( |
|
| 316 | array( |
|
| 317 | new Criterion\LocationId( |
|
| 318 | array(4, 12, 13) |
|
| 319 | ), |
|
| 320 | new Criterion\LocationId( |
|
| 321 | array(13, 44) |
|
| 322 | ), |
|
| 323 | ) |
|
| 324 | ), |
|
| 325 | 'limit' => 10, |
|
| 326 | ) |
|
| 327 | ) |
|
| 328 | ) |
|
| 329 | ); |
|
| 330 | } |
|
| 331 | ||
| 332 | public function testLocationIdParentLocationIdAndCombinatorFilter() |
|
| 333 | { |
|
| @@ 495-511 (lines=17) @@ | ||
| 492 | ); |
|
| 493 | } |
|
| 494 | ||
| 495 | public function testVisibilityFilterVisible() |
|
| 496 | { |
|
| 497 | $this->assertSearchResults( |
|
| 498 | array(2, 5, 12, 13, 14), |
|
| 499 | $this->getContentSearchHandler()->findLocations( |
|
| 500 | new LocationQuery( |
|
| 501 | array( |
|
| 502 | 'filter' => new Criterion\Visibility( |
|
| 503 | Criterion\Visibility::VISIBLE |
|
| 504 | ), |
|
| 505 | 'limit' => 5, |
|
| 506 | 'sortClauses' => array(new SortClause\Location\Id()), |
|
| 507 | ) |
|
| 508 | ) |
|
| 509 | ) |
|
| 510 | ); |
|
| 511 | } |
|
| 512 | ||
| 513 | public function testVisibilityFilterHidden() |
|
| 514 | { |
|
| @@ 639-653 (lines=15) @@ | ||
| 636 | ); |
|
| 637 | } |
|
| 638 | ||
| 639 | public function testContentTypeIdentifierFilter() |
|
| 640 | { |
|
| 641 | $this->assertSearchResults( |
|
| 642 | array(43, 48, 51, 52, 53), |
|
| 643 | $this->getContentSearchHandler()->findLocations( |
|
| 644 | new LocationQuery( |
|
| 645 | array( |
|
| 646 | 'filter' => new Criterion\ContentTypeIdentifier('folder'), |
|
| 647 | 'limit' => 5, |
|
| 648 | 'sortClauses' => array(new SortClause\Location\Id()), |
|
| 649 | ) |
|
| 650 | ) |
|
| 651 | ) |
|
| 652 | ); |
|
| 653 | } |
|
| 654 | ||
| 655 | public function testObjectStateIdFilter() |
|
| 656 | { |
|
| @@ 757-774 (lines=18) @@ | ||
| 754 | ); |
|
| 755 | } |
|
| 756 | ||
| 757 | public function testDateMetadataFilterModifiedIn() |
|
| 758 | { |
|
| 759 | $this->assertSearchResults( |
|
| 760 | array(12, 15, 227, 228), |
|
| 761 | $this->getContentSearchHandler()->findLocations( |
|
| 762 | new LocationQuery( |
|
| 763 | array( |
|
| 764 | 'filter' => new Criterion\DateMetadata( |
|
| 765 | Criterion\DateMetadata::MODIFIED, |
|
| 766 | Criterion\Operator::IN, |
|
| 767 | array(1311154214, 1311154215) |
|
| 768 | ), |
|
| 769 | 'limit' => 10, |
|
| 770 | ) |
|
| 771 | ) |
|
| 772 | ) |
|
| 773 | ); |
|
| 774 | } |
|
| 775 | ||
| 776 | public function testDateMetadataFilterModifiedBetween() |
|
| 777 | { |
|
| @@ 776-793 (lines=18) @@ | ||
| 773 | ); |
|
| 774 | } |
|
| 775 | ||
| 776 | public function testDateMetadataFilterModifiedBetween() |
|
| 777 | { |
|
| 778 | $this->assertSearchResults( |
|
| 779 | array(12, 15, 227, 228), |
|
| 780 | $this->getContentSearchHandler()->findLocations( |
|
| 781 | new LocationQuery( |
|
| 782 | array( |
|
| 783 | 'filter' => new Criterion\DateMetadata( |
|
| 784 | Criterion\DateMetadata::MODIFIED, |
|
| 785 | Criterion\Operator::BETWEEN, |
|
| 786 | array(1311154213, 1311154215) |
|
| 787 | ), |
|
| 788 | 'limit' => 10, |
|
| 789 | ) |
|
| 790 | ) |
|
| 791 | ) |
|
| 792 | ); |
|
| 793 | } |
|
| 794 | ||
| 795 | public function testDateMetadataFilterCreatedBetween() |
|
| 796 | { |
|
| @@ 795-812 (lines=18) @@ | ||
| 792 | ); |
|
| 793 | } |
|
| 794 | ||
| 795 | public function testDateMetadataFilterCreatedBetween() |
|
| 796 | { |
|
| 797 | $this->assertSearchResults( |
|
| 798 | array(68, 133, 227), |
|
| 799 | $this->getContentSearchHandler()->findLocations( |
|
| 800 | new LocationQuery( |
|
| 801 | array( |
|
| 802 | 'filter' => new Criterion\DateMetadata( |
|
| 803 | Criterion\DateMetadata::CREATED, |
|
| 804 | Criterion\Operator::BETWEEN, |
|
| 805 | array(1299780749, 1311154215) |
|
| 806 | ), |
|
| 807 | 'limit' => 10, |
|
| 808 | ) |
|
| 809 | ) |
|
| 810 | ) |
|
| 811 | ); |
|
| 812 | } |
|
| 813 | ||
| 814 | public function testUserMetadataFilterOwnerWrongUserId() |
|
| 815 | { |
|