@@ 290-304 (lines=15) @@ | ||
287 | /** |
|
288 | * @covers VDB\Spider\Spider::crawl |
|
289 | */ |
|
290 | public function testCrawlDFSMaxQueueSize() |
|
291 | { |
|
292 | $this->spider->getDiscovererSet()->maxDepth = 1000; |
|
293 | $this->spider->downloadLimit = 3; |
|
294 | ||
295 | $this->spider->crawl(); |
|
296 | ||
297 | $expected = array( |
|
298 | $this->linkA, |
|
299 | $this->linkE, |
|
300 | $this->linkF, |
|
301 | ); |
|
302 | ||
303 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
304 | } |
|
305 | ||
306 | public function testCrawlBFSMaxQueueSize() |
|
307 | { |
|
@@ 306-321 (lines=16) @@ | ||
303 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
304 | } |
|
305 | ||
306 | public function testCrawlBFSMaxQueueSize() |
|
307 | { |
|
308 | $this->spider->getQueueManager()->setTraversalAlgorithm(InMemoryQueueManager::ALGORITHM_BREADTH_FIRST); |
|
309 | $this->spider->getDiscovererSet()->maxDepth = 1000; |
|
310 | $this->spider->downloadLimit = 3; |
|
311 | ||
312 | $this->spider->crawl(); |
|
313 | ||
314 | $expected = array( |
|
315 | $this->linkA, |
|
316 | $this->linkB, |
|
317 | $this->linkC, |
|
318 | ); |
|
319 | ||
320 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
321 | } |
|
322 | ||
323 | /** |
|
324 | * @covers VDB\Spider\Spider::crawl |