/** * @param InputInterface $input * @param OutputInterface $output */ protected final function execute(InputInterface $input, OutputInterface $output) { $this->loadConfig($input); $environment = $input->getOption('environment') ?: $this->config->getDefaultEnvironment(); $this->adapter = AdapterFactory::instance($this->config->getEnvironmentConfig($environment)); $this->manager = new Manager($this->config, $this->adapter); $this->check($input, $output); $start = microtime(true); $this->runCommand($input, $output); $output->writeln(''); $output->write('<comment>All done. Took ' . sprintf('%.4fs', microtime(true) - $start) . '</comment>'); $output->writeln(''); }
public function testOverridenDefaults() { $config = new Config(['default_environment' => 'second', 'log_table_name' => 'custom_log_table_name', 'migration_dirs' => ['first_dir', 'second_dir'], 'environments' => ['first' => [], 'second' => []]]); $this->assertEquals('custom_log_table_name', $config->getLogTableName()); $this->assertCount(2, $config->getMigrationDirs()); $this->assertEquals('second', $config->getDefaultEnvironment()); $this->assertInstanceOf('\\Phoenix\\Config\\EnvironmentConfig', $config->getEnvironmentConfig('first')); $this->assertInstanceOf('\\Phoenix\\Config\\EnvironmentConfig', $config->getEnvironmentConfig('second')); }