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


PHP Session::isStarted方法代碼示例

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


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

示例1: startSession

 /**
  * Create session.
  *
  * @return void
  */
 protected function startSession()
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     $this->session->visit($_SERVER['WEB_FIXTURE_URL'] . '/tests/QATools/QATools/Live/PageObject/index.html');
 }
開發者ID:eltonoliveira,項目名稱:qa-tools,代碼行數:12,代碼來源:AbstractLiveTestCase.php

示例2: shoot

 /**
  *
  * @return array
  */
 public function shoot()
 {
     $this->_session = $this->_camera->get_session();
     // Iterate over shots
     foreach ($this->_shots as $shot) {
         /* @var $shot Shot */
         $output = $this->_shoot_shot($shot);
         $this->_log_out("Saving as " . $this->_film->get_root_folder() . $shot->get_destination_file());
         // Save output in folder
         if (empty($output)) {
             $this->_log_out("There was an error capturing this page. Please, check or retry. ");
             continue;
         }
         $saved_result = $this->_film->get_filesystem()->put($shot->get_destination_file(), $output);
         if (!$saved_result) {
             $this->_log_out("There was an error saving the screenshot. Please, check or retry. ");
             continue;
         }
         // It was successful, mark it
         $shot->set_completed(true);
     }
     // If session is open (it should) just close it
     if ($this->_session->isStarted()) {
         $this->_session->stop();
     }
     return $this->_shots;
 }
開發者ID:pachico,項目名稱:voyeur,代碼行數:31,代碼來源:Voyeur.php

示例3: getSession

 /**
  * Creates Mink session using current session strategy and returns it.
  *
  * @return Session
  */
 public function getSession()
 {
     if ($this->_session && $this->_session->isStarted()) {
         return $this->_session;
     }
     $browser = $this->getBrowser();
     try {
         $this->_session = $this->getSessionStrategy()->session($browser);
         if ($this->getCollectCodeCoverageInformation()) {
             $this->_session->visit($browser->getBaseUrl());
         }
     } catch (DriverException $e) {
         $message = 'The Selenium Server is not active on host %s at port %s';
         $this->markTestSkipped(sprintf($message, $browser->getHost(), $browser->getPort()));
     }
     return $this->_session;
 }
開發者ID:aik099,項目名稱:phpunit-mink,代碼行數:22,代碼來源:BrowserTestCase.php

示例4: testIsStarted

 public function testIsStarted()
 {
     $this->driver->expects($this->once())->method('isStarted')->will($this->returnValue(true));
     $this->assertTrue($this->session->isStarted());
 }
開發者ID:saberyounis,項目名稱:Sonata-Project,代碼行數:5,代碼來源:SessionTest.php


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