|
@@ 605-615 (lines=11) @@
|
| 602 |
|
} |
| 603 |
|
|
| 604 |
|
|
| 605 |
|
public function testSearchFieldsMappingForClasses() { |
| 606 |
|
$qg = new QueryGenerator(); |
| 607 |
|
$qg->setClasses('FlickrPhotoTO,Page'); |
| 608 |
|
$fields = array('Title' => 2, 'Description' => 1); |
| 609 |
|
$expected = array('Title^2', 'Title.*^2','Description', 'Description.*'); |
| 610 |
|
$this->assertEquals($expected, $qg->convertWeightedFieldsForElastica($fields)); |
| 611 |
|
|
| 612 |
|
$qg->setClasses(array('FlickrPhotoTO','Page')); |
| 613 |
|
$this->assertEquals($expected, $qg->convertWeightedFieldsForElastica($fields)); |
| 614 |
|
|
| 615 |
|
} |
| 616 |
|
|
| 617 |
|
|
| 618 |
|
public function testSearchFieldsMappingForClassesCaching() { |
|
@@ 641-651 (lines=11) @@
|
| 638 |
|
} |
| 639 |
|
|
| 640 |
|
|
| 641 |
|
public function testSearchFieldsMappingForSiteTree() { |
| 642 |
|
$qg = new QueryGenerator(); |
| 643 |
|
$qg->setClasses(null); // select all of site tree classes |
| 644 |
|
$fields = array('Title' => 2, 'Content' => 1); |
| 645 |
|
$expected = array('Title^2', 'Title.*^2','Content', 'Content.*'); |
| 646 |
|
$this->assertEquals($expected, $qg->convertWeightedFieldsForElastica($fields)); |
| 647 |
|
|
| 648 |
|
$qg->setClasses(array('FlickrPhotoTO','Page')); |
| 649 |
|
$this->assertEquals($expected, $qg->convertWeightedFieldsForElastica($fields)); |
| 650 |
|
|
| 651 |
|
} |
| 652 |
|
|
| 653 |
|
|
| 654 |
|
public function testPagination() { |