/** * @param $module * @param $name * @param $class * @param $containerAware * * @dataProvider commandData */ public function testGenerateCommand($module, $name, $class, $containerAware) { $generator = new CommandGenerator(); $this->getHelperSet()->get('renderer')->setSkeletonDirs($this->getSkeletonDirs()); $this->getHelperSet()->get('renderer')->setTranslator($this->getTranslatorHelper()); $generator->setHelpers($this->getHelperSet()); $generator->generate($module, $name, $class, $containerAware); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); $module = $input->getOption('module'); $class = $input->getOption('class'); $name = $input->getOption('name'); $containerAware = $input->getOption('container-aware'); $services = $input->getOption('services'); $yes = $input->hasOption('yes') ? $input->getOption('yes') : false; // @see use Drupal\Console\Command\Shared\ConfirmationTrait::confirmGeneration if (!$this->confirmGeneration($io, $yes)) { return; } // @see use Drupal\Console\Command\Shared\ServicesTrait::buildServices $build_services = $this->buildServices($services); $this->generator->generate($module, $name, $class, $containerAware, $build_services); }