当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::getCrawler方法代码示例

本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Client::getCrawler方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::getCrawler方法的具体用法?PHP Client::getCrawler怎么用?PHP Client::getCrawler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Bundle\FrameworkBundle\Client的用法示例。


在下文中一共展示了Client::getCrawler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLogout

 /**
  * @depends testLogin
  */
 public function testLogout(Client $client)
 {
     $this->setSecurityContextUser();
     $crawler = $client->getCrawler();
     $crawler = $client->request('GET', self::URL_DECONNECTION);
     $this->assertEquals(302, $client->getResponse()->getStatusCode());
     $this->assertEquals(self::URL_DECONNECTION, $client->getRequest()->getRequestUri());
     $crawler = $client->followRedirect();
     $this->assertEquals(200, $client->getResponse()->getStatusCode());
     $this->assertEquals('/en/', $client->getRequest()->getRequestUri());
 }
开发者ID:pigroupe,项目名称:SfynxAuthBundle,代码行数:14,代码来源:LoginTest.php

示例2: submitThemeUploadForm

 /**
  * @return void
  */
 private function submitThemeUploadForm()
 {
     $form = $this->client->getCrawler()->selectButton('Install')->form();
     $_FILES['file'] = ['name' => "{$this->fileName}.zip", 'type' => 'application/zip', 'tmp_name' => "{$this->fileName}.zip", 'error' => 0, 'size' => 0];
     $this->submitEditForm($this->client, $form, ['form' => 'upload']);
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:9,代码来源:UploadThemeTest.php

示例3: assertSEOCompatible

 protected function assertSEOCompatible(Client $client, $type = 'article')
 {
     $crawler = $client->getCrawler();
     $url = $client->getRequest()->getUri();
     $title = $crawler->filter('title')->text();
     // title
     $this->assertNotEmpty($title, 'The title is empty.');
     // meta
     $this->assertCount(1, $crawler->filter('meta[charset=UTF-8]'));
     $this->assertCount(1, $crawler->filter('meta[property="og:title"][content="' . $title . '"]'));
     $this->assertCount(1, $crawler->filter('meta[property="og:type"][content="' . $type . '"]'));
     $this->assertCount(1, $crawler->filter('meta[property="og:url"][content="' . $url . '"]'));
     // img
     // $this->assertCount(0, $crawler->filter('img[alt=""]'));
     $crawler->filter('img:not([alt])')->each(function ($node, $i) {
         $this->assertTrue(false, 'An image with no alt attribute has been found src=' . $node->attr('src'));
     });
 }
开发者ID:pigroupe,项目名称:SfynxAuthBundle,代码行数:18,代码来源:WebTestCase.php

示例4: getCrawler

 /**
  * Returns the current Crawler instance.
  *
  * @return Crawler|null A Crawler instance
  *
  * @api
  */
 public function getCrawler()
 {
     return $this->subject->getCrawler();
 }
开发者ID:kleijnweb,项目名称:swagger-bundle,代码行数:11,代码来源:ApiTestClient.php


注:本文中的Symfony\Bundle\FrameworkBundle\Client::getCrawler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。