getCrawler() public method

Returns the current Crawler instance.
public getCrawler ( ) : Crawler
return Symfony\Component\DomCrawler\Crawler A Crawler instance
示例#1
0
 /**
  * @param $client
  * @param $position 0 based index position
  * @return mixed
  */
 private function getPageEditUriFromListByPosition(Client $client, $position)
 {
     $crawler = $client->getCrawler();
     if (strpos($client->getRequest()->getUri(), '/admin/cmf/page/page/list') === false) {
         $crawler = $client->request('GET', '/admin/cmf/page/page/list');
     }
     $this->assertTrue($client->getResponse()->isSuccessful());
     $rows = $crawler->filter('table tbody tr');
     return $rows->eq($position)->filter('td')->eq(1)->filter('a')->attr('href');
 }