public function testGetConsoleReturnsAnInstanceOfConsole() { $zf2ComponentsListGenerator = new Zf2ComponentsListGenerator(); $this->assertInstanceOf('\\Zend\\Console\\Adapter\\AdapterInterface', $zf2ComponentsListGenerator->getConsole()); }
$opts->parse(); } catch (Zend\Console\Exception\ExceptionInterface $e) { file_put_contents('php://stderr', $e->getUsageMessage()); exit(1); } // Print help message if asked or nothing is asked if (isset($opts->h) || $opts->toArray() == array()) { file_put_contents('php://stdout', $opts->getUsageMessage()); exit(0); } // Create options $options = array(); if (isset($opts->v)) { $options['version'] = $opts->v; } $zf2ComponentsListGenerator = new Zf2ComponentsListGenerator($options); $generator = $zf2ComponentsListGenerator->scan($opts->p); $components = $generator->getComponents(); $console = Console::getInstance(); if (!empty($components)) { if (isset($opts->c)) { if (!is_file($opts->c)) { $console->writeLine($opts->c . ' file does not exist!'); } else { $generator->toFile($opts->c); $console->writeLine($opts->c . ' updated', Color::YELLOW); } } else { $generator->toConsole(); } } else {