Esempio n. 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $command = $this->getApplication()->find('element:set');
     $class = $input->getArgument('theme');
     if (!$class) {
         $class = 'Magento19';
     }
     $resolver = new ThemeResolver();
     $class = $resolver->resolve($class);
     $internalInput = new ArrayInput(['command' => $command->getName(), 'class' => $class, 'property' => 'baseUrl', 'value' => $input->getArgument('url')]);
     $command->run($internalInput, $output);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $test = new ListProductsInCategoryTest();
     $test->setName('testExecute');
     if ($input->getOption('url')) {
         $test->setBaseUrl($input->getOption('url'));
     }
     if ($input->getOption('theme')) {
         $resolver = new ThemeResolver();
         $test->setTheme($resolver->resolve($input->getOption('theme')));
     }
     $test->setCategoryPath($input->getArgument('category'));
     $test->run();
     $products = $test->getProductNames();
     $output->writeln('Found ' . count($products) . ' products in ' . $input->getArgument('category'));
     foreach ($products as $product) {
         $output->writeln("\t" . trim($product));
     }
 }