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