->checkRequirements()
->setupDatabase()
->setupAdmin()
+ ->setupConfig()
->setupAsset()
;
protected function checkRequirements()
{
- $this->defaultOutput->writeln('<info><comment>Step 1 of 4.</comment> Checking system requirements.</info>');
+ $this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>');
$fulfilled = true;
protected function setupDatabase()
{
- $this->defaultOutput->writeln('<info><comment>Step 2 of 4.</comment> Setting up database.</info>');
+ $this->defaultOutput->writeln('<info><comment>Step 2 of 5.</comment> Setting up database.</info>');
// user want to reset everything? Don't care about what is already here
if (true === $this->defaultInput->getOption('reset')) {
protected function setupAdmin()
{
- $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>');
+ $this->defaultOutput->writeln('<info><comment>Step 3 of 5.</comment> Administration setup.</info>');
$questionHelper = $this->getHelperSet()->get('question');
$question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true);
$em->persist($config);
+ $this->defaultOutput->writeln('');
+
+ return $this;
+ }
+
+ protected function setupConfig()
+ {
+ $this->defaultOutput->writeln('<info><comment>Step 4 of 5.</comment> Config setup.</info>');
+ $em = $this->getContainer()->get('doctrine.orm.entity_manager');
+
// cleanup before insert new stuff
$em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute();
protected function setupAsset()
{
- $this->defaultOutput->writeln('<info><comment>Step 4 of 4.</comment> Installing assets.</info>');
+ $this->defaultOutput->writeln('<info><comment>Step 5 of 5.</comment> Installing assets.</info>');
$this
->runCommand('assets:install')
'command' => $command->getName(),
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
}
public function testRunInstallCommandWithReset()
'--reset' => true,
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
// we force to reset everything
$this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
'command' => $command->getName(),
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
// the current database doesn't already exist
$this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay());
'command' => $command->getName(),
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
$this->assertContains('Droping schema and creating schema', $tester->getDisplay());
}
'command' => $command->getName(),
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
$this->assertContains('Creating schema', $tester->getDisplay());
}
'--no-interaction' => true,
));
- $this->assertContains('Step 1 of 4. Checking system requirements.', $tester->getDisplay());
- $this->assertContains('Step 2 of 4. Setting up database.', $tester->getDisplay());
- $this->assertContains('Step 3 of 4. Administration setup.', $tester->getDisplay());
- $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
+ $this->assertContains('Checking system requirements.', $tester->getDisplay());
+ $this->assertContains('Setting up database.', $tester->getDisplay());
+ $this->assertContains('Administration setup.', $tester->getDisplay());
+ $this->assertContains('Config setup.', $tester->getDisplay());
+ $this->assertContains('Installing assets.', $tester->getDisplay());
}
}