/** * Test callback. */ public function testExecute() { $discovery = new GeneratorDiscovery([DCG_ROOT . '/src/Commands'], [DCG_ROOT . '/src/Templates'], new Filesystem()); $generators = $discovery->getGenerators(); foreach ($generators as $generator) { $this->assertInstanceOf('DrupalCodeGenerator\\Commands\\BaseGenerator', $generator); } $this->assertCount(self::TOTAL_GENERATORS, $generators); }
/** * {@inheritdoc} */ public function setUp() { $this->application = new Application('Drupal Code Generator', '@git-version@'); $discovery = new GeneratorDiscovery([DCG_ROOT . '/src/Commands'], [DCG_ROOT . '/src/Templates'], new Filesystem()); $generators = $discovery->getGenerators(); $this->application->addCommands($generators); $navigation = new Navigation(); $navigation->init($generators); $this->application->add($navigation); $this->command = $this->application->find('navigation'); $this->questionHelper = $this->createMock('Symfony\\Component\\Console\\Helper\\QuestionHelper'); $this->helperSet = $this->command->getHelperSet(); $this->commandTester = new CommandTester($this->command); $this->filesystem = new Filesystem(); $this->destination = DCG_SANDBOX . '/tests'; }