public function testConfigModeWithoutKeys() { $options = array('adapter' => 'MyAdapter', 'adapteroptions' => array('host' => 'myhost', 'port' => 8080), 'querytype' => array(array('type' => 'myquerytype', 'query' => 'MyQuery', 'requestbuilder' => 'MyRequestBuilder', 'responseparser' => 'MyResponseParser')), 'plugin' => array(array('key' => 'myplugin', 'plugin' => 'MyClientPlugin', 'options' => array('option1' => 'value1', 'option2' => 'value2')))); $this->_client->setOptions($options); $adapter = $this->_client->getAdapter(); $this->assertThat($adapter, $this->isInstanceOf('MyAdapter')); $this->assertEquals(8080, $adapter->getPort()); $queryTypes = $this->_client->getQueryTypes(); $this->assertEquals(array('requestbuilder' => 'MyRequestBuilder', 'responseparser' => 'MyResponseParser', 'query' => 'MyQuery'), $queryTypes['myquerytype']); $plugin = $this->_client->getPlugin('myplugin'); $this->assertThat($plugin, $this->isInstanceOf('MyClientPlugin')); $this->assertEquals($options['plugin'][0]['options'], $plugin->getOptions()); }
/** * This allows internal manipulation of the specific core being queried by this service. * There is probably a better way to do this, but this is the least disruptive way to handle this somewhat circular dependency. * @return \Wikia\Search\QueryService\Select\AbstractSelect */ protected function setCoreInClient() { $options = $this->client->getOptions(); $options['adapteroptions']['path'] = '/solr/' . $this->core; $this->client->setOptions($options, true); $this->coreSetInClient = true; return $this; }