_facet = new Solarium_Query_Select_Component_Facet_Field; } public function testConfigMode() { $options = array( 'key' => 'myKey', 'exclude' => array('e1','e2'), 'field' => 'text', 'sort' => 'index', 'limit' => 10, 'offset' => 20, 'mincount' => 5, 'missing' => true, 'method' => 'enum', ); $this->_facet->setOptions($options); $this->assertEquals($options['key'], $this->_facet->getKey()); $this->assertEquals($options['exclude'], $this->_facet->getExcludes()); $this->assertEquals($options['field'], $this->_facet->getField()); $this->assertEquals($options['sort'], $this->_facet->getSort()); $this->assertEquals($options['limit'], $this->_facet->getLimit()); $this->assertEquals($options['offset'], $this->_facet->getOffset()); $this->assertEquals($options['mincount'], $this->_facet->getMinCount()); $this->assertEquals($options['missing'], $this->_facet->getMissing()); $this->assertEquals($options['method'], $this->_facet->getMethod()); } public function testGetType() { $this->assertEquals( Solarium_Query_Select_Component_FacetSet::FACET_FIELD, $this->_facet->getType() ); } public function testSetAndGetField() { $this->_facet->setField('category'); $this->assertEquals('category', $this->_facet->getField()); } public function testSetAndGetSort() { $this->_facet->setSort('index'); $this->assertEquals('index', $this->_facet->getSort()); } public function testSetAndGetPrefix() { $this->_facet->setPrefix('xyz'); $this->assertEquals('xyz', $this->_facet->getPrefix()); } public function testSetAndGetLimit() { $this->_facet->setLimit(12); $this->assertEquals(12, $this->_facet->getLimit()); } public function testSetAndGetOffset() { $this->_facet->setOffset(40); $this->assertEquals(40, $this->_facet->getOffset()); } public function testSetAndGetMinCount() { $this->_facet->setMincount(100); $this->assertEquals(100, $this->_facet->getMincount()); } public function testSetAndGetMissing() { $this->_facet->setMissing(true); $this->assertEquals(true, $this->_facet->getMissing()); } public function testSetAndGetMethod() { $this->_facet->setMethod('enum'); $this->assertEquals('enum', $this->_facet->getMethod()); } }