/** * @return CommandTester */ private function createCommandTester() { $twig = new \Twig_Environment(new \Twig_Loader_Filesystem()); $command = new LintCommand(); $command->setTwigEnvironment($twig); $application = new Application(); $application->add($command); $command = $application->find('lint:twig'); return new CommandTester($command); }
protected function findFiles($filename) { if (0 === strpos($filename, '@')) { $dir = $this->getApplication()->getKernel()->locateResource($filename); return Finder::create()->files()->in($dir)->name('*.twig'); } return parent::findFiles($filename); }