本文整理汇总了PHP中Behat\Mink\Session::stop方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::stop方法的具体用法?PHP Session::stop怎么用?PHP Session::stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Behat\Mink\Session
的用法示例。
在下文中一共展示了Session::stop方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stopMinkSession
/**
* Shut down the Mink session.
*
* @return void
*/
protected function stopMinkSession()
{
if (!empty($this->session)) {
$this->session->stop();
$this->session = null;
}
}
示例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: stopSession
/**
* Stops session.
*
* @return void
*/
protected function stopSession()
{
if ($this->_session === null) {
return;
}
$this->_session->stop();
$this->_session = null;
}
示例4: _after
public function _after(\Codeception\TestCase $test)
{
//that call does not really terminate node process
//@see https://github.com/symfony/symfony/issues/5499
$this->session->stop();
//so we kill it ourselves
exec('killall ' . pathinfo($this->server->getNodeBin(), PATHINFO_BASENAME) . ' > /dev/null 2>&1');
}
示例5: testStop
public function testStop()
{
$this->driver->expects($this->once())->method('stop');
$this->session->stop();
}
示例6: _after
public function _after(TestCase $test)
{
$this->session->stop();
}
示例7: _after
public function _after(\Codeception\TestCase $test)
{
$this->session->stop();
}
示例8: Session
<?php
require __DIR__ . '/vendor/autoload.php';
use Behat\Mink\Driver\GoutteDriver;
use Behat\Mink\Driver\Selenium2Driver;
use Behat\Mink\Session;
//$driver = new GoutteDriver();
$driver = new Selenium2Driver();
$session = new Session($driver);
$session->start();
$session->visit('http://jurassicpark.wikia.com');
//echo "The status code is ".$session->getStatusCode()."\n";
echo "The current URL is " . $session->getCurrentUrl() . "\n";
// Hallo! I'm a DocumentElement
$page = $session->getPage();
echo "The start of the page text is " . substr($page->getText(), 0, 56) . "\n";
// And I'm a NodeElement!
$nodeElement = $page->find('css', '.subnav-2 li a');
echo "The matched link text is " . $nodeElement->getText() . "\n";
$randomLink = $page->findLink('Random page');
echo "The matched URL is " . $randomLink->getAttribute('href') . "\n";
$randomLink->click();
echo "The new URL is " . $session->getCurrentUrl() . "\n";
$session->stop();
示例9: iCloseTheSession
/**
* @Then /^I close the session$/
*/
public function iCloseTheSession()
{
$this->session->stop();
}
示例10: tearDown
public function tearDown()
{
$this->session->stop();
}