示例#1
0
 public function testCreateDbConfig()
 {
     $testData = [ConfigOptionsList::INPUT_KEY_DB_HOST => 'testLocalhost', ConfigOptionsList::INPUT_KEY_DB_NAME => 'testDbName', ConfigOptionsList::INPUT_KEY_DB_USER => 'testDbUser', ConfigOptionsList::INPUT_KEY_DB_PREFIX => 'testSomePrefix'];
     $returnValue = $this->configGeneratorObject->createDbConfig($testData);
     $this->assertEquals(ConfigFilePool::APP_CONFIG, $returnValue->getFileKey());
     $dbData = $returnValue->getData();
     $dbData = $dbData['db'];
     $this->assertArrayHasKey('table_prefix', $dbData);
     $this->assertSame('testSomePrefix', $dbData['table_prefix']);
     $this->assertArrayHasKey('connection', $dbData);
     $this->assertArrayHasKey('default', $dbData['connection']);
     $this->assertArrayHasKey('host', $dbData['connection']['default']);
     $this->assertSame('testLocalhost', $dbData['connection']['default']['host']);
     $this->assertArrayHasKey('dbname', $dbData['connection']['default']);
     $this->assertSame('testDbName', $dbData['connection']['default']['dbname']);
     $this->assertArrayHasKey('username', $dbData['connection']['default']);
     $this->assertSame('testDbUser', $dbData['connection']['default']['username']);
     $this->assertArrayHasKey('active', $dbData['connection']['default']);
     $this->assertSame('1', $dbData['connection']['default']['active']);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function createConfig(array $data, DeploymentConfig $deploymentConfig)
 {
     $configData = [];
     $configData[] = $this->configGenerator->createInstallConfig($deploymentConfig);
     $configData[] = $this->configGenerator->createCryptConfig($data, $deploymentConfig);
     $configData[] = $this->configGenerator->createSessionConfig($data);
     $definitionConfig = $this->configGenerator->createDefinitionsConfig($data);
     if (isset($definitionConfig)) {
         $configData[] = $definitionConfig;
     }
     $configData[] = $this->configGenerator->createDbConfig($data);
     $configData[] = $this->configGenerator->createResourceConfig();
     return $configData;
 }