_facet = new Solarium_Query_Select_Component_Facet_Range; } public function testConfigMode() { $options = array( 'key' => 'myKey', 'exclude' => array('e1','e2'), 'field' => 'content', 'start' => 1, 'end' => 100, 'gap' => 10, 'hardend' => true, 'other' => 'all', 'include' => 'lower', ); $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['start'], $this->_facet->getStart()); $this->assertEquals($options['end'], $this->_facet->getEnd()); $this->assertEquals($options['gap'], $this->_facet->getGap()); $this->assertEquals($options['hardend'], $this->_facet->getHardend()); $this->assertEquals($options['other'], $this->_facet->getOther()); $this->assertEquals($options['include'], $this->_facet->getInclude()); } public function testGetType() { $this->assertEquals( Solarium_Query_Select_Component_FacetSet::FACET_RANGE, $this->_facet->getType() ); } public function testSetAndGetField() { $this->_facet->setField('price'); $this->assertEquals('price', $this->_facet->getField()); } public function testSetAndGetStart() { $this->_facet->setStart(1); $this->assertEquals(1, $this->_facet->getStart()); } public function testSetAndGetEnd() { $this->_facet->setEnd(100); $this->assertEquals(100, $this->_facet->getEnd()); } public function testSetAndGetGap() { $this->_facet->setGap(10); $this->assertEquals(10, $this->_facet->getGap()); } public function testSetAndGetHardend() { $this->_facet->setHardend(true); $this->assertEquals(true, $this->_facet->getHardend()); } public function testSetAndGetOther() { $this->_facet->setOther('all'); $this->assertEquals('all', $this->_facet->getOther()); } public function testSetAndGetOtherArray() { $this->_facet->setOther(array('before','after')); $this->assertEquals('before,after', $this->_facet->getOther()); } public function testSetAndGetInclude() { $this->_facet->setInclude('all'); $this->assertEquals('all', $this->_facet->getInclude()); } public function testSetAndGetIncludeArray() { $this->_facet->setInclude(array('lower','upper')); $this->assertEquals('lower,upper', $this->_facet->getInclude()); } }