| @@ 490-511 (lines=22) @@ | ||
| 487 | ); |
|
| 488 | } |
|
| 489 | ||
| 490 | public function testSortLocationVisibilityAscending() |
|
| 491 | { |
|
| 492 | $handler = $this->getContentSearchHandler(); |
|
| 493 | ||
| 494 | $locations = $handler->findLocations( |
|
| 495 | new LocationQuery( |
|
| 496 | array( |
|
| 497 | 'filter' => new Criterion\LocationId(array(45, 228)), |
|
| 498 | 'offset' => 0, |
|
| 499 | 'limit' => null, |
|
| 500 | 'sortClauses' => array( |
|
| 501 | new SortClause\Location\Visibility(LocationQuery::SORT_ASC), |
|
| 502 | ), |
|
| 503 | ) |
|
| 504 | ) |
|
| 505 | ); |
|
| 506 | ||
| 507 | $this->assertSearchResults( |
|
| 508 | array(45, 228), |
|
| 509 | $locations |
|
| 510 | ); |
|
| 511 | } |
|
| 512 | ||
| 513 | public function testSortLocationVisibilityDescending() |
|
| 514 | { |
|
| @@ 513-534 (lines=22) @@ | ||
| 510 | ); |
|
| 511 | } |
|
| 512 | ||
| 513 | public function testSortLocationVisibilityDescending() |
|
| 514 | { |
|
| 515 | $handler = $this->getContentSearchHandler(); |
|
| 516 | ||
| 517 | $locations = $handler->findLocations( |
|
| 518 | new LocationQuery( |
|
| 519 | array( |
|
| 520 | 'filter' => new Criterion\LocationId(array(45, 228)), |
|
| 521 | 'offset' => 0, |
|
| 522 | 'limit' => null, |
|
| 523 | 'sortClauses' => array( |
|
| 524 | new SortClause\Location\Visibility(LocationQuery::SORT_DESC), |
|
| 525 | ), |
|
| 526 | ) |
|
| 527 | ) |
|
| 528 | ); |
|
| 529 | ||
| 530 | $this->assertSearchResults( |
|
| 531 | array(228, 45), |
|
| 532 | $locations |
|
| 533 | ); |
|
| 534 | } |
|
| 535 | ||
| 536 | public function testSortSectionName() |
|
| 537 | { |
|
| @@ 693-714 (lines=22) @@ | ||
| 690 | ); |
|
| 691 | } |
|
| 692 | ||
| 693 | public function testSortIsMainLocationAscending() |
|
| 694 | { |
|
| 695 | $handler = $this->getContentSearchHandler(); |
|
| 696 | ||
| 697 | $locations = $handler->findLocations( |
|
| 698 | new LocationQuery( |
|
| 699 | array( |
|
| 700 | 'filter' => new Criterion\ParentLocationId(224), |
|
| 701 | 'offset' => 0, |
|
| 702 | 'limit' => null, |
|
| 703 | 'sortClauses' => array( |
|
| 704 | new SortClause\Location\IsMainLocation(LocationQuery::SORT_ASC), |
|
| 705 | ), |
|
| 706 | ) |
|
| 707 | ) |
|
| 708 | ); |
|
| 709 | ||
| 710 | $this->assertSearchResults( |
|
| 711 | array(510, 225), |
|
| 712 | $locations |
|
| 713 | ); |
|
| 714 | } |
|
| 715 | ||
| 716 | public function testSortIsMainLocationDescending() |
|
| 717 | { |
|
| @@ 716-737 (lines=22) @@ | ||
| 713 | ); |
|
| 714 | } |
|
| 715 | ||
| 716 | public function testSortIsMainLocationDescending() |
|
| 717 | { |
|
| 718 | $handler = $this->getContentSearchHandler(); |
|
| 719 | ||
| 720 | $locations = $handler->findLocations( |
|
| 721 | new LocationQuery( |
|
| 722 | array( |
|
| 723 | 'filter' => new Criterion\ParentLocationId(224), |
|
| 724 | 'offset' => 0, |
|
| 725 | 'limit' => null, |
|
| 726 | 'sortClauses' => array( |
|
| 727 | new SortClause\Location\IsMainLocation(LocationQuery::SORT_DESC), |
|
| 728 | ), |
|
| 729 | ) |
|
| 730 | ) |
|
| 731 | ); |
|
| 732 | ||
| 733 | $this->assertSearchResults( |
|
| 734 | array(225, 510), |
|
| 735 | $locations |
|
| 736 | ); |
|
| 737 | } |
|
| 738 | } |
|
| 739 | ||