本文整理汇总了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');
}
示例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;
}
示例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;
}
示例4: testIsStarted
public function testIsStarted()
{
$this->driver->expects($this->once())->method('isStarted')->will($this->returnValue(true));
$this->assertTrue($this->session->isStarted());
}