Наследование: extends Symfony\Component\Console\Helper\Helper
 public function testConfigurationHelperWithoutConfigurationFromSetterAndWithoutOverrideFromCommandLineAndWithoutConfigInPath()
 {
     $this->input->expects($this->any())->method('getOption')->with('configuration')->will($this->returnValue(null));
     $configurationHelper = new ConfigurationHelper($this->connection, null);
     $migrationConfig = $configurationHelper->getMigrationConfig($this->input, $this->getOutputWriter());
     $this->assertInstanceOf('Doctrine\\DBAL\\Migrations\\Configuration\\Configuration', $migrationConfig);
     $this->assertStringMatchesFormat("", $this->getOutputStreamContent($this->output));
 }
Пример #2
0
 /**
  * When any (config) command line option is passed to the migration the migrationConfiguration
  * property is set with the new generated configuration.
  * If no (config) option is passed the migrationConfiguration property is set to the value
  * of the configuration one (if any).
  * Else a new configuration is created and assigned to the migrationConfiguration property.
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return Configuration
  */
 protected function getMigrationConfiguration(InputInterface $input, OutputInterface $output)
 {
     if (!$this->migrationConfiguration) {
         if ($this->getHelperSet()->has('configuration')) {
             $configHelper = $this->getHelperSet()->get('configuration');
         } else {
             $configHelper = new ConfigurationHelper($this->getConnection($input), $this->configuration);
         }
         $this->migrationConfiguration = $configHelper->getMigrationConfig($input, $this->getOutputWriter($output));
     }
     return $this->migrationConfiguration;
 }