getHelperSet()); $command->setHelperSet($this->getHelperSet()); $command->setGenerator($this->getGenerator()); $commandTester = new CommandTester($command); $code = $commandTester->execute( [ '--module' => $module, '--class' => $plugin_class, '--plugin-name' => $plugin_name, '--plugin-file-name' => $plugin_file_name ], ['interactive' => false] ); $this->assertEquals(0, $code); } private function getGenerator() { return $this ->getMockBuilder('Drupal\Console\Generator\PluginTypeYamlGenerator') ->disableOriginalConstructor() ->setMethods(['generate']) ->getMock(); } }