/** * Load the configuration items from all of the files. * * @param \Viserio\Contracts\Foundation\Application $app * @param \Viserio\Contracts\Config\Manager $configManager */ protected function loadConfigurationFiles(Application $app, ConfigManager $configManager) { $configPath = realpath($app->get(ConfigManager::class)->get('path.config')); foreach ($this->getFiles($configPath) as $key => $path) { $configManager->import($path); } }
public function testImportWithGroup() { $config = new ConfigManager(new Repository()); $config->setLoader($this->fileloader); $file = vfsStream::newFile('temp.json')->withContent(' { "a":1, "b":2, "c":3 } ')->at($this->root); $config->import($file->url(), 'test'); $this->assertTrue($config->has('test::a')); $this->assertSame(2, $config->get('test::b')); $this->assertTrue($config->has('test::c')); }