public function CookieTest::testSessionPersistsBetweenRequests in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php \Behat\Mink\Tests\Driver\Basic\CookieTest::testSessionPersistsBetweenRequests()
File
- vendor/
behat/ mink/ driver-testsuite/ tests/ Basic/ CookieTest.php, line 149
Class
Namespace
Behat\Mink\Tests\Driver\BasicCode
public function testSessionPersistsBetweenRequests() {
$this
->getSession()
->visit($this
->pathTo('/session_test.php'));
$webAssert = $this
->getAssertSession();
$node = $webAssert
->elementExists('css', '#session-id');
$sessionId = $node
->getText();
$this
->getSession()
->visit($this
->pathTo('/session_test.php'));
$node = $webAssert
->elementExists('css', '#session-id');
$this
->assertEquals($sessionId, $node
->getText());
$this
->getSession()
->visit($this
->pathTo('/session_test.php?login'));
$node = $webAssert
->elementExists('css', '#session-id');
$this
->assertNotEquals($sessionId, $newSessionId = $node
->getText());
$this
->getSession()
->visit($this
->pathTo('/session_test.php'));
$node = $webAssert
->elementExists('css', '#session-id');
$this
->assertEquals($newSessionId, $node
->getText());
}