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