protected function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var $doctrine \Doctrine\Common\Persistence\ManagerRegistry */
     $doctrine = $this->getContainer()->get('doctrine');
     /** @var EntityManager $em */
     $em = $doctrine->getManager($input->getOption('em'));
     $generator = new GeneratorService();
     $generator->setAnnotationReader(new AnnotationReader());
     $generator->setTwigEngine($this->getContainer()->get('twig'));
     $filteredClassList = ExtJSModelsSaver::filterClassList($em, $em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames());
     (new ExtJSModelsSaver())->setDirToSaveGeneratedModels($input->getArgument('target-dir'))->setGenerator($generator)->setEntityManager($em)->init()->addEntitiesToGenerate($filteredClassList)->run();
 }
 public function testSimpleRun()
 {
     $this->predefinedModelSaver->init()->addEntitiesToGenerate(ExtJSModelsSaver::filterClassList($this->em, self::$fullClassNamesList))->run();
     $this->assertTrue(file_exists($this->dirWithGeneratedModels));
     $this->assertTrue(is_dir($this->dirWithGeneratedModels));
 }