Beispiel #1
0
 public function testGetOutgoingLinks()
 {
     $document = new Document(file_get_contents(__DIR__ . '/fixtures/referencedUrls.html'));
     $urls = $document->getOutgoingLinks(new Uri('http://www.example.com/test/'));
     foreach ($urls as $url) {
         $currentUrls[] = (string) $url;
     }
     $expectedUrls = array('http://www.example.com/test/images/relative_path.html?withQuery', 'http://www.example.com/test/images/relative_path.html', 'http://www.example.com/', 'http://www.notexample.com/foreign_domain.html');
     sort($expectedUrls);
     sort($currentUrls);
     $this->assertEquals($currentUrls, $expectedUrls);
 }