getHelperSet()); $command->setHelperSet($this->getHelperSet()); $command->setGenerator($this->getGenerator()); $commandTester = new CommandTester($command); $code = $commandTester->execute( [ '--module' => $module, '--class' => $class_name, '--plugin-id' => $plugin_id, '--plugin-label' => $plugin_label, '--plugin-url' => $plugin_url, '--plugin-states' => $plugin_states, ], ['interactive' => false] ); $this->assertEquals(0, $code); } private function getGenerator() { return $this ->getMockBuilder('Drupal\Console\Generator\PluginRestResourceGenerator') ->disableOriginalConstructor() ->setMethods(['generate']) ->getMock(); } }