當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Client::submit方法代碼示例

本文整理匯總了PHP中Symfony\Component\HttpKernel\Client::submit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::submit方法的具體用法?PHP Client::submit怎麽用?PHP Client::submit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\HttpKernel\Client的用法示例。


在下文中一共展示了Client::submit方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doLogin

 /**
  * Do login with username
  *
  * @param string $username
  */
 private function doLogin($username = 'admin')
 {
     $crawler = $this->client->request('GET', $this->getUrl('fos_user_security_login', array()));
     $form = $crawler->selectButton('_submit')->form(array('_username' => $username, '_password' => 'qwerty'));
     $this->client->submit($form);
     $this->assertTrue($this->client->getResponse()->isRedirect());
     $this->client->followRedirects();
 }
開發者ID:alienpham,項目名稱:portfolio,代碼行數:13,代碼來源:UploadControllerTest.php

示例2: login

 /**
  * Log into the application using a provided username and password.
  * @param string $username
  * @param string $password
  * @return Crawler
  */
 public function login($username, $password)
 {
     $crawler = $this->client->request('GET', $this->profileUrl);
     $form = $crawler->selectButton('_submit')->form();
     $form['_username'] = $username;
     $form['_password'] = $password;
     $crawler = $this->client->submit($form);
     return $crawler;
 }
開發者ID:cegeka,項目名稱:symfony-toolkit,代碼行數:15,代碼來源:FunctionalBase.php

示例3: testTicketReplyErrors

 /**
  * Отображение ошибки при ответе
  */
 public function testTicketReplyErrors()
 {
     $crawler = $this->client->request('GET', '/ticket/6/show?_locale=ru');
     $form = $crawler->selectButton('Message[submit]')->form();
     $crawler = $this->client->submit($form);
     static::assertGreaterThan(0, $crawler->filter('html:contains("Заполните поле Сообщение или загрузите изображение")')->count());
 }
開發者ID:dreamlex,項目名稱:ticketbundle,代碼行數:10,代碼來源:TicketControllerTest.php

示例4: testLogout

 public function testLogout()
 {
     $this->authorize();
     $listUrl = $this->urlGenerator->generate('list', ['bucket' => 'foo']);
     $this->s3ClientMock->expects($this->once())->method('listBuckets')->willReturn(new Result([]));
     $this->s3ClientMock->expects($this->once())->method('listObjects')->willReturn(new Result([]));
     $crawler = $this->client->request('GET', $listUrl);
     $this->assertTrue($this->client->getResponse()->isOk());
     $form = $crawler->filter('#form-logout')->form();
     $this->client->submit($form);
     $this->assertTrue($this->client->getResponse()->isRedirect('http://localhost' . $listUrl));
     $cookies = $this->client->getResponse()->headers->getCookies();
     $this->assertCount(1, $cookies);
     $this->assertEquals($this->app['amazon_s3_credentials_cookie_name'], $cookies[0]->getName());
     $this->assertNull($cookies[0]->getValue());
 }
開發者ID:ossinkine,項目名稱:amazon-s3-client,代碼行數:16,代碼來源:ApplicationTest.php

示例5: submitLoginForm

 /**
  * @param string $username
  * @param string $password
  */
 protected function submitLoginForm($username, $password)
 {
     $this->loginForm[self::USERNAME_FIELD] = $username;
     $this->loginForm[self::PASSWORD_FIELD] = $password;
     $this->crawler = $this->client->submit($this->loginForm);
 }
開發者ID:GrossumUA,項目名稱:Symfony3-Base-Instance,代碼行數:10,代碼來源:AbstractLoginTest.php


注:本文中的Symfony\Component\HttpKernel\Client::submit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。