/** * {@inheritdoc} */ public function getContextConfig($key) { $config = $this->allConfig(); if (isset($config['contexts'][$key])) { $config = array_merge($config, $config['contexts'][$key]); } return Hash::reduce($config, ['user', 'pass', 'host', 'port', 'database']); }
/** * Test that reduce() reduces the size of the array. */ public function testReduce() { $this->assertEquals(array('boolean' => true, 'integer' => 123), Hash::reduce($this->expanded, array('boolean', 'integer', 'foobar'))); }