mirror of
https://github.com/symfony/maker-bundle.git
synced 2026-03-23 23:42:10 +01:00
[make:migration] Add --nowdoc option
This commit is contained in:
committed by
Jérôme Tamarelle
parent
08192e197e
commit
ff15d3faa6
@@ -74,6 +74,7 @@ final class MakeMigration extends AbstractMaker implements ApplicationAwareMaker
|
||||
|
||||
$command
|
||||
->addOption('formatted', null, InputOption::VALUE_NONE, 'Format the generated SQL')
|
||||
->addOption('nowdoc', null, InputOption::VALUE_NONE, 'Use nowdoc format for generated SQL')
|
||||
->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path of doctrine configuration file')
|
||||
;
|
||||
}
|
||||
@@ -99,6 +100,10 @@ final class MakeMigration extends AbstractMaker implements ApplicationAwareMaker
|
||||
$options[] = '--formatted';
|
||||
}
|
||||
|
||||
if ($input->getOption('nowdoc')) {
|
||||
$options[] = '--nowdoc';
|
||||
}
|
||||
|
||||
if (null !== $configuration = $input->getOption('configuration')) {
|
||||
$options[] = '--configuration='.$configuration;
|
||||
}
|
||||
|
||||
@@ -142,5 +142,16 @@ class MakeMigrationTest extends MakerTestCase
|
||||
$this->assertStringContainsString('Success', $output);
|
||||
}),
|
||||
];
|
||||
|
||||
yield 'it_generates_a_nowdoc_migration' => [$this->createMakeMigrationTest()
|
||||
->addRequiredPackageVersion('doctrine/doctrine-migrations-bundle', '>=3')
|
||||
->run(function (MakerTestRunner $runner) {
|
||||
$runner->runConsole('make:migration', [], '--nowdoc');
|
||||
|
||||
$output = $runner->runMaker([/* no input */]);
|
||||
|
||||
$this->assertStringContainsString('Success', $output);
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user