Exemplo n.º 1
0
 public function addStartPages(array $uris)
 {
     foreach ($uris as $uri) {
         $page = new Page($uri);
         $this->domainWhitelist->add($page->getDomain());
         $page->setClient($this->client);
         $this->startpages->add($page);
     }
 }
Exemplo n.º 2
0
 /**
  * @return PagesCollection New Collection with all found links
  */
 public function findLinkedPages()
 {
     $pages = new PagesCollection();
     $crawler = $this->getCrawler();
     foreach ($crawler->filter('a') as $node) {
         $link = new Link($node, $this->uri);
         $page = new Page($link->getUri());
         $page->setClient($this->client);
         $pages->add($page);
     }
     return $pages;
 }
Exemplo n.º 3
0
 /** @test */
 public function getDomain()
 {
     $page = new Page('http://example.com/foobar#test');
     $this->assertEquals('example.com', $page->getDomain());
 }