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


PHP Session::getDriver方法代码示例

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


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

示例1: getMessageElement

 /**
  * @return NodeElement
  *
  * @throws ElementNotFoundException
  */
 private function getMessageElement()
 {
     $messageElement = $this->session->getPage()->find('css', self::NOTIFICATION_ELEMENT_CSS);
     if (null === $messageElement) {
         throw new ElementNotFoundException($this->session->getDriver(), 'message element', 'css', self::NOTIFICATION_ELEMENT_CSS);
     }
     return $messageElement;
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:13,代码来源:NotificationAccessor.php

示例2: prepareMinkSessionIfNeeded

 private function prepareMinkSessionIfNeeded()
 {
     if ($this->minkSession->getDriver() instanceof KernelDriver) {
         return;
     }
     if (false !== strpos($this->minkSession->getCurrentUrl(), $this->minkParameters['base_url'])) {
         return;
     }
     $this->minkSession->visit(rtrim($this->minkParameters['base_url'], '/') . '/');
 }
开发者ID:Mozan,项目名称:Sylius,代码行数:10,代码来源:CookieSetter.php

示例3: prepareSessionIfNeeded

 private function prepareSessionIfNeeded()
 {
     if (!$this->minkSession->getDriver() instanceof Selenium2Driver) {
         return;
     }
     if (false !== strpos($this->minkSession->getCurrentUrl(), $this->minkParameters['base_url'])) {
         return;
     }
     $this->homePage->open();
 }
开发者ID:Andretti23,项目名称:Sylius,代码行数:10,代码来源:SecurityContext.php

示例4: __construct

 /**
  * Initialize element.
  *
  * @param Session $session
  */
 public function __construct(Session $session)
 {
     $this->xpathManipulator = new Manipulator();
     $this->session = $session;
     $this->driver = $session->getDriver();
     $this->selectorsHandler = $session->getSelectorsHandler();
 }
开发者ID:molchanoviv,项目名称:Mink,代码行数:12,代码来源:Element.php

示例5:

 function it_loads_base_url_and_sets_a_cookie_if_not_using_kernel_driver_and_driver_is_currently_outside_base_url(Session $minkSession, DriverInterface $driver)
 {
     $minkSession->getDriver()->willReturn($driver);
     $minkSession->getCurrentUrl()->willReturn('http://sylius.org');
     $minkSession->visit('http://localhost:8080/')->shouldBeCalled();
     $minkSession->setCookie('abc', 'def')->shouldBeCalled();
     $this->setCookie('abc', 'def');
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:8,代码来源:CookieSetterSpec.php

示例6: getSymfonyDriver

 /**
  * Get the Symfony driver.
  * 
  * @return BrowserKitDriver
  *
  * @throws UnsupportedDriverActionException when not using mink browser kit driver
  */
 protected function getSymfonyDriver()
 {
     $driver = $this->session->getDriver();
     if ($driver instanceof BrowserKitDriver === false) {
         throw new UnsupportedDriverActionException('Not using the Symfony Driver - current driver is %s', $driver);
     }
     return $driver;
 }
开发者ID:totaltrash,项目名称:symfony-testing,代码行数:15,代码来源:WebAssert.php

示例7: getResponseInfo

 /**
  * Returns response information string.
  *
  * @return  string
  */
 protected function getResponseInfo()
 {
     $driver = basename(str_replace('\\', '/', get_class($this->session->getDriver())));
     $info = '+--[ ';
     if (!in_array($driver, array('SahiDriver', 'SeleniumDriver'))) {
         $info .= 'HTTP/1.1 ' . $this->session->getStatusCode() . ' | ';
     }
     $info .= $this->session->getCurrentUrl() . ' | ' . $driver . " ]\n|\n";
     return $info;
 }
开发者ID:kingsj,项目名称:core,代码行数:15,代码来源:Exception.php

示例8: __construct

 /**
  * Initializes exception.
  *
  * @param string                  $message   optional message
  * @param DriverInterface|Session $driver    driver instance (or session for BC)
  * @param \Exception|null         $exception expectation exception
  */
 public function __construct($message, $driver, \Exception $exception = null)
 {
     if ($driver instanceof Session) {
         @trigger_error('Passing a Session object to the ExpectationException constructor is deprecated as of Mink 1.7. Pass the driver instead.', E_USER_DEPRECATED);
         $this->session = $driver;
         $this->driver = $driver->getDriver();
     } elseif (!$driver instanceof DriverInterface) {
         // Trigger an exception as we cannot typehint a disjunction
         throw new \InvalidArgumentException('The ExpectationException constructor expects a DriverInterface or a Session.');
     } else {
         $this->driver = $driver;
     }
     if (!$message && null !== $exception) {
         $message = $exception->getMessage();
     }
     parent::__construct($message, 0, $exception);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:24,代码来源:ExpectationException.php

示例9: getDriver

 /**
  * @return DriverInterface
  */
 protected function getDriver()
 {
     return $this->session->getDriver();
 }
开发者ID:vikey89,项目名称:Sylius,代码行数:7,代码来源:Page.php

示例10: testGetDriver

 public function testGetDriver()
 {
     $this->assertSame($this->driver, $this->session->getDriver());
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:4,代码来源:SessionTest.php

示例11: _sendRequest

 public function _sendRequest($url)
 {
     $this->session->visit($url);
     return $this->session->getDriver()->getContent();
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:5,代码来源:Mink.php

示例12: getSessionId

 /**
  * Get Selenium2 current session id.
  *
  * @param Session $session Session.
  *
  * @return string
  * @throws \RuntimeException When session was created using an unsupported driver.
  */
 protected function getSessionId(Session $session)
 {
     $driver = $session->getDriver();
     if ($driver instanceof Selenium2Driver) {
         return $driver->getWebDriverSessionId();
     }
     throw new \RuntimeException('Unsupported session driver');
 }
开发者ID:aik099,项目名称:phpunit-mink,代码行数:16,代码来源:ApiBrowserConfiguration.php

示例13: getRequestDataLogMessage

 /**
  * @param Session $session
  *
  * @return string|null
  */
 private function getRequestDataLogMessage(Session $session)
 {
     $driver = $session->getDriver();
     if (!$driver instanceof BrowserKitDriver) {
         return null;
     }
     try {
         return 'Request:' . "\n" . print_r($driver->getClient()->getRequest(), true) . "\n";
     } catch (MinkException $exception) {
         return null;
     }
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:17,代码来源:FeatureContext.php

示例14: getClient

 /**
  * @return Client
  */
 private function getClient()
 {
     return $this->session->getDriver()->getClient();
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:7,代码来源:EmailChecker.php


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