Exemplo n.º 1
0
 /**
  * Getter for the config.
  *
  * @return Config Returns the config instance.
  */
 public function getConfig()
 {
     if (!$this->config) {
         $this->config = \MvcLite\Config::getInstance();
     }
     return $this->config;
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * 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);
 }