public function getConfig($key = '') { $config = $this->getParam('config'); if (empty($key)) { return $config; } if (!array_key_exists($key, $config)) { throw new InvalidException('Config key is not set: ' . $key); } return $config[$key]; }
/** * @group unit * @expectedException \Elastica\Exception\InvalidException */ public function testGetConfigInvalidValue() { $connection = new Connection(); $connection->getConfig('url'); }