/** * @test */ public function verifyFailedCrawledDocumentsGetMarkedAsFailed() { $this->addMockResponse(404); $this->documentRepository->expects($this->once())->method('markAsFailed'); $this->inject($this->crawlerService, 'documentRepository', $this->documentRepository); $this->crawlerService->crawl("/foo"); }
/** * Process the crawler process command * * @param InputInterface $input * @param OutputInterface $output * * @return int|null|void */ protected function execute(InputInterface $input, OutputInterface $output) { $url = trim($input->getOption('url')); if ($url != '') { $this->crawlerService->crawl($url); } else { $output->writeln($this->getHelp()); } }