예제 #1
0
 public function testBuild()
 {
     $builder = new Solarium_Client_RequestBuilder_Select_Component_Grouping();
     $request = new Solarium_Client_Request();
     $component = new Solarium_Query_Select_Component_Grouping();
     $component->setFields(array('fieldA', 'fieldB'));
     $component->setQueries(array('cat:1', 'cat:2'));
     $component->setLimit(12);
     $component->setOffset(2);
     $component->setSort('score desc');
     $component->setMainResult(true);
     $component->setNumberOfGroups(false);
     $component->setCachePercentage(50);
     $request = $builder->build($component, $request);
     $this->assertEquals(array('group' => 'true', 'group.field' => array('fieldA', 'fieldB'), 'group.query' => array('cat:1', 'cat:2'), 'group.limit' => 12, 'group.offset' => 2, 'group.sort' => 'score desc', 'group.main' => 'true', 'group.ngroups' => 'false', 'group.cache.percent' => 50), $request->getParams());
 }
예제 #2
0
 public function testSetAndGetFieldsArray()
 {
     $values = array('fieldD', 'fieldE');
     $this->_grouping->setFields($values);
     $this->assertEquals($values, $this->_grouping->getFields());
 }