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()); }
public function testSetAndGetNumberOfGroups() { $value = true; $this->_grouping->setNumberOfGroups($value); $this->assertEquals($value, $this->_grouping->getNumberOfGroups()); }