_adapter = new TestAdapter(); } public function testConfigMode() { $options = array( 'host' => '192.168.0.1', 'port' => 123, 'path' => '/mysolr/', 'core' => 'mycore', 'timeout' => 3, ); $this->_adapter->setOptions($options); $options['path'] = '/mysolr'; //expected trimming of trailing slash $this->assertEquals($options, $this->_adapter->getOptions()); } public function testSetAndGetHost() { $this->_adapter->setHost('myhost'); $this->assertEquals('myhost', $this->_adapter->getHost()); } public function testSetAndGetPort() { $this->_adapter->setPort(8080); $this->assertEquals(8080, $this->_adapter->getPort()); } public function testSetAndGetPath() { $this->_adapter->setPath('/mysolr'); $this->assertEquals('/mysolr', $this->_adapter->getPath()); } public function testSetAndGetPathWithTrailingSlash() { $this->_adapter->setPath('/mysolr/'); $this->assertEquals('/mysolr', $this->_adapter->getPath()); } public function testSetAndGetCore() { $this->_adapter->setCore('core1'); $this->assertEquals('core1', $this->_adapter->getCore()); } public function testSetAndGetTimeout() { $this->_adapter->setTimeout(7); $this->assertEquals(7, $this->_adapter->getTimeout()); } public function testGetBaseUri() { $this->_adapter->setHost('myserver')->setPath('/mypath')->setPort(123); $this->assertEquals('http://myserver:123/mypath/', $this->_adapter->getBaseUri()); } public function testGetBaseUriWithCore() { $this->_adapter->setHost('myserver')->setPath('/mypath')->setPort(123)->setCore('mycore'); $this->assertEquals('http://myserver:123/mypath/mycore/', $this->_adapter->getBaseUri()); } } class TestAdapter extends Solarium_Client_Adapter { public function execute($request) { } }