_facet = new TestFacet; } public function testConfigMode() { $this->_facet->setOptions(array('key' => 'myKey','exclude' => array('e1','e2'))); $this->assertEquals('myKey', $this->_facet->getKey()); $this->assertEquals(array('e1','e2'), $this->_facet->getExcludes()); } public function testConfigModeWithSingleValueExclude() { $this->_facet->setOptions(array('exclude' => 'e1')); $this->assertEquals(array('e1'), $this->_facet->getExcludes()); } public function testSetAndGetKey() { $this->_facet->setKey('testkey'); $this->assertEquals('testkey', $this->_facet->getKey()); } public function testAddExclude() { $this->_facet->addExclude('e1'); $this->assertEquals(array('e1'), $this->_facet->getExcludes()); } public function testAddExcludes() { $this->_facet->addExcludes(array('e1','e2')); $this->assertEquals(array('e1','e2'), $this->_facet->getExcludes()); } public function testRemoveExclude() { $this->_facet->addExcludes(array('e1','e2')); $this->_facet->removeExclude('e1'); $this->assertEquals(array('e2'), $this->_facet->getExcludes()); } public function testClearExcludes() { $this->_facet->addExcludes(array('e1','e2')); $this->_facet->clearExcludes(); $this->assertEquals(array(), $this->_facet->getExcludes()); } public function testSetExcludes() { $this->_facet->addExcludes(array('e1','e2')); $this->_facet->setExcludes(array('e3','e4')); $this->assertEquals(array('e3','e4'), $this->_facet->getExcludes()); } } class TestFacet extends Solarium_Query_Select_Component_Facet{ public function getType() { return 'test'; } }