/** * Getter for the config. * * @return Config Returns the config instance. */ public function getConfig() { if (!$this->config) { $this->config = \MvcLite\Config::getInstance(); } return $this->config; }
/** * Tests the config's get method. * * @param string $key The key to lookup * @param mixed $value The value that should exist * * @dataProvider provideGet */ public function testGet($expected, $key, $data) { $sut = Config::getInstance(); $this->setReflectionPropertyValue($sut, 'data', $data); $result = $sut->get($key); $this->assertEquals($expected, $result); }
/** * Tests MvcLite\Config::getSection. * * @dataProvider provideGetSection */ public function testGetSection($expected, $name, $data) { $sut = \MvcLite\Config::getInstance(); $sut->setAll($data); $result = $sut->getSection($name); $this->assertEquals($expected, $result); }