| @@ 410-431 (lines=22) @@ | ||
| 407 | ); |
|
| 408 | } |
|
| 409 | ||
| 410 | public function testSortLocationVisibilityAscending() |
|
| 411 | { |
|
| 412 | $handler = $this->getContentSearchHandler(); |
|
| 413 | ||
| 414 | $locations = $handler->findLocations( |
|
| 415 | new LocationQuery( |
|
| 416 | array( |
|
| 417 | 'filter' => new Criterion\LocationId(array(45, 228)), |
|
| 418 | 'offset' => 0, |
|
| 419 | 'limit' => null, |
|
| 420 | 'sortClauses' => array( |
|
| 421 | new SortClause\Location\Visibility(LocationQuery::SORT_ASC), |
|
| 422 | ), |
|
| 423 | ) |
|
| 424 | ) |
|
| 425 | ); |
|
| 426 | ||
| 427 | $this->assertSearchResults( |
|
| 428 | array(45, 228), |
|
| 429 | $locations |
|
| 430 | ); |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testSortLocationVisibilityDescending() |
|
| 434 | { |
|
| @@ 433-454 (lines=22) @@ | ||
| 430 | ); |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testSortLocationVisibilityDescending() |
|
| 434 | { |
|
| 435 | $handler = $this->getContentSearchHandler(); |
|
| 436 | ||
| 437 | $locations = $handler->findLocations( |
|
| 438 | new LocationQuery( |
|
| 439 | array( |
|
| 440 | 'filter' => new Criterion\LocationId(array(45, 228)), |
|
| 441 | 'offset' => 0, |
|
| 442 | 'limit' => null, |
|
| 443 | 'sortClauses' => array( |
|
| 444 | new SortClause\Location\Visibility(LocationQuery::SORT_DESC), |
|
| 445 | ), |
|
| 446 | ) |
|
| 447 | ) |
|
| 448 | ); |
|
| 449 | ||
| 450 | $this->assertSearchResults( |
|
| 451 | array(228, 45), |
|
| 452 | $locations |
|
| 453 | ); |
|
| 454 | } |
|
| 455 | ||
| 456 | public function testSortSectionName() |
|
| 457 | { |
|
| @@ 613-634 (lines=22) @@ | ||
| 610 | ); |
|
| 611 | } |
|
| 612 | ||
| 613 | public function testSortIsMainLocationAscending() |
|
| 614 | { |
|
| 615 | $handler = $this->getContentSearchHandler(); |
|
| 616 | ||
| 617 | $locations = $handler->findLocations( |
|
| 618 | new LocationQuery( |
|
| 619 | array( |
|
| 620 | 'filter' => new Criterion\ParentLocationId(224), |
|
| 621 | 'offset' => 0, |
|
| 622 | 'limit' => null, |
|
| 623 | 'sortClauses' => array( |
|
| 624 | new SortClause\Location\IsMainLocation(LocationQuery::SORT_ASC), |
|
| 625 | ), |
|
| 626 | ) |
|
| 627 | ) |
|
| 628 | ); |
|
| 629 | ||
| 630 | $this->assertSearchResults( |
|
| 631 | array(510, 225), |
|
| 632 | $locations |
|
| 633 | ); |
|
| 634 | } |
|
| 635 | ||
| 636 | public function testSortIsMainLocationDescending() |
|
| 637 | { |
|
| @@ 636-657 (lines=22) @@ | ||
| 633 | ); |
|
| 634 | } |
|
| 635 | ||
| 636 | public function testSortIsMainLocationDescending() |
|
| 637 | { |
|
| 638 | $handler = $this->getContentSearchHandler(); |
|
| 639 | ||
| 640 | $locations = $handler->findLocations( |
|
| 641 | new LocationQuery( |
|
| 642 | array( |
|
| 643 | 'filter' => new Criterion\ParentLocationId(224), |
|
| 644 | 'offset' => 0, |
|
| 645 | 'limit' => null, |
|
| 646 | 'sortClauses' => array( |
|
| 647 | new SortClause\Location\IsMainLocation(LocationQuery::SORT_DESC), |
|
| 648 | ), |
|
| 649 | ) |
|
| 650 | ) |
|
| 651 | ); |
|
| 652 | ||
| 653 | $this->assertSearchResults( |
|
| 654 | array(225, 510), |
|
| 655 | $locations |
|
| 656 | ); |
|
| 657 | } |
|
| 658 | } |
|
| 659 | ||