@@ 253-267 (lines=15) @@ | ||
250 | /** |
|
251 | * @covers VDB\Spider\Spider::crawl |
|
252 | */ |
|
253 | public function testCrawlDFSMaxQueueSize() |
|
254 | { |
|
255 | $this->spider->getQueueManager()->maxDepth = 1000; |
|
256 | $this->spider->downloadLimit = 3; |
|
257 | ||
258 | $this->spider->crawl(); |
|
259 | ||
260 | $expected = array( |
|
261 | $this->linkA, |
|
262 | $this->linkE, |
|
263 | $this->linkF, |
|
264 | ); |
|
265 | ||
266 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
267 | } |
|
268 | ||
269 | public function testCrawlBFSMaxQueueSize() |
|
270 | { |
|
@@ 269-284 (lines=16) @@ | ||
266 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
267 | } |
|
268 | ||
269 | public function testCrawlBFSMaxQueueSize() |
|
270 | { |
|
271 | $this->spider->getQueueManager()->setTraversalAlgorithm(InMemoryQueueManager::ALGORITHM_BREADTH_FIRST); |
|
272 | $this->spider->getQueueManager()->maxDepth = 1000; |
|
273 | $this->spider->downloadLimit = 3; |
|
274 | ||
275 | $this->spider->crawl(); |
|
276 | ||
277 | $expected = array( |
|
278 | $this->linkA, |
|
279 | $this->linkB, |
|
280 | $this->linkC, |
|
281 | ); |
|
282 | ||
283 | $this->assertEquals($expected, $this->statsHandler->getPersisted()); |
|
284 | } |
|
285 | ||
286 | /** |
|
287 | * @covers VDB\Spider\Spider::crawl |