明確にできるように順序を設定したいと思います: テストモードをキャッシュしてから、データベースを削除し、スキーマを削除し、スキームを追加し、テストモードでフィクスチャを追加します。
class BaseCommand extends \Symfony\Component\Console\Command\Command {
//put your code here
protected function configure()
{
$this
->setName('mycommand:test')
->setDescription('Launch test')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$command_first_migration = $this->getApplication()->find('cache:clear');
$arguments_first_migration = array(
'command' => 'cache:clean',
'--env' => 'test'
);
$input_first_migration = new ArrayInput($arguments_first_migration);
try {
$returnCode = $command_first_migration->run($input_first_migration, $output);
} catch (\Doctrine\DBAL\Migrations\MigrationException $ex) {
echo "MigrationExcepion !!!! ";
}
}
}
しかし、私はこの結果を持っています:
clearing the case for the dev environment with debug true
開発環境でテストに合格するには?
ありがとうございました