Exemplo n.º 1
0
 /**
  * Get the database configuration based on the environment's setting.
  *
  * @return mixed
  */
 protected function getDatabaseConfig()
 {
     $environment = $this->app->getEnvironment();
     $config = $this->app->getConfig('database');
     $config = $this->app->arrGet($environment, $config, []);
     if (empty($config)) {
         throw new \InvalidArgumentException(sprintf('Database is not configured for [%s] environment!', $environment));
     }
     return $config;
 }
Exemplo n.º 2
0
 /**
  * @expectedException LogicException
  */
 public function testGetConfigInvalidArgumentException()
 {
     $app = new App();
     $app->getConfig();
 }