Skip to content

Commit 0fe1849

Browse files
committed
Improve isolation of timeout tests
1 parent 60fb967 commit 0fe1849

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/Custom/TimeoutTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ class TimeoutTest extends TestCase
99
{
1010
use ExpectException;
1111

12+
/**
13+
* @after
14+
*/
15+
protected function resetSessions()
16+
{
17+
$session = $this->getSession();
18+
19+
// Stop the session instead of only resetting it, as timeouts are not reset (they are configuring the session itself)
20+
if ($session->isStarted()) {
21+
$session->stop();
22+
}
23+
24+
// Reset the array of timeouts to avoid impacting other tests
25+
$session->getDriver()->setTimeouts(array());
26+
27+
parent::resetSessions();
28+
}
29+
1230
public function testInvalidTimeoutSettingThrowsException()
1331
{
1432
$this->expectException('\Behat\Mink\Exception\DriverException');

0 commit comments

Comments
 (0)