better tests for interlinked and redirect tracking
This commit is contained in:
@@ -76,23 +76,38 @@ class CrawlerTest extends TestCase{
|
||||
public function testInterlinked(){
|
||||
$crawler=new Crawler();
|
||||
$crawler->crawl('http://localhost:8080/interlinked1');
|
||||
//$crawler->crawl('http://localhost:8080/page4'); // TODO!!! this ensures the order or results for the URL tracking test 3PARTS.
|
||||
$crawler->crawl('http://localhost:8080/interlinked4'); //this ensures the order or results for the URL tracking test PART2
|
||||
$sitemap=$crawler->getResults();
|
||||
$this->assertTreeContains($sitemap,[
|
||||
'http://localhost:8080/interlinked1' => ['code' => 200 , 'foundOn' => [
|
||||
'http://localhost:8080/interlinked1' => 1,
|
||||
'http://localhost:8080/interlinked2' => 1,
|
||||
'http://localhost:8080/interlinked3' => 1,
|
||||
'http://localhost:8080/interlinked4' => 1,
|
||||
]],
|
||||
'http://localhost:8080/interlinked2' => ['code' => 200 , 'foundOn' => [
|
||||
'http://localhost:8080/interlinked1' => 1,
|
||||
'http://localhost:8080/interlinked2' => 1,
|
||||
'http://localhost:8080/interlinked3' => 1,
|
||||
'http://localhost:8080/interlinked4' => 1,
|
||||
]],
|
||||
'http://localhost:8080/interlinked3' => ['code' => 200 , 'foundOn' => [
|
||||
'http://localhost:8080/interlinked1' => 1,
|
||||
'http://localhost:8080/interlinked2' => 1,
|
||||
'http://localhost:8080/interlinked3' => 1,
|
||||
'http://localhost:8080/interlinked4' => 1,
|
||||
]],
|
||||
'http://localhost:8080/found' => ['code' => 200 , 'foundOn' => [
|
||||
'http://localhost:8080/interlinked1' => 1,
|
||||
'http://localhost:8080/interlinked2' => 1,
|
||||
'http://localhost:8080/interlinked3' => 1,
|
||||
'http://localhost:8080/interlinked4' => 1,
|
||||
]],
|
||||
'http://localhost:8080/redirectToFound' => ['code' => 302 , 'foundOn' => [
|
||||
'http://localhost:8080/interlinked1' => 1,
|
||||
'http://localhost:8080/interlinked2' => 1,
|
||||
'http://localhost:8080/interlinked3' => 1,
|
||||
'http://localhost:8080/interlinked4' => 1,
|
||||
]],
|
||||
], print_r($sitemap,true));
|
||||
}
|
||||
|
Reference in New Issue
Block a user