/** * PluginImageEffect generator test * * @param $module * @param $class_name * @param $plugin_label * @param $plugin_id * @param $description * * @dataProvider commandData */ public function testGeneratePluginImageEffect($module, $class_name, $label, $plugin_id, $description) { $generator = new PluginImageEffectGenerator(); $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs()); $this->getRenderHelper()->setTranslator($this->getTranslatorHelper()); $generator->setHelperSet($this->getHelperSet()); $generator->generate($module, $class_name, $label, $plugin_id, $description); $this->assertTrue(file_exists($generator->getSite()->getPluginPath($module, 'ImageEffect') . '/' . $class_name . '.php'), sprintf('%s does not exist', $class_name . '.php')); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); // @see use Drupal\Console\Command\Shared\ConfirmationTrait::confirmGeneration if (!$this->confirmGeneration($io)) { return; } $module = $input->getOption('module'); $class_name = $input->getOption('class'); $label = $input->getOption('label'); $plugin_id = $input->getOption('plugin-id'); $description = $input->getOption('description'); $this->generator->generate($module, $class_name, $label, $plugin_id, $description); $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']); }