public function testSetNotExistentKeyOfTypeConfig() { $config = new Config([]); $config->set('aKey', 'aValue'); $this->config->set('newKey', $config); $this->assertEquals('aValue', $this->config->get('newKey')->get('aKey')); }
protected function checkGeneratedConfigIsCorrect(Config $config) { $this->assertEquals('notAnArray', $config->get('b')); $this->assertEquals('alsoNotAnArray', $config->get('c')); $this->assertEquals('value', $config->get('a')->get('property')->get(0)); $this->assertEquals('deeperValue', $config->get('a')->get('property')->get('deeper')); $this->assertEquals('root', $config->get('PRODUCTION')->get('DB')->get('user')); $this->assertEquals('root', $config->get('PRODUCTION')->get('DB')->get('pass')); $this->assertEquals('localhost', $config->get('PRODUCTION')->get('DB')->get('host')); }
public function __construct(Config $config) { $this->config = $config->getFullConfigAsArray(); }