-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to determine session freshness state
- Loading branch information
Showing
10 changed files
with
183 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
library/aik099/PHPUnit/Session/AbstractSessionStrategy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/** | ||
* This file is part of the phpunit-mink library. | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @copyright Alexander Obuhovich <[email protected]> | ||
* @link https://github.com/aik099/phpunit-mink | ||
*/ | ||
|
||
namespace aik099\PHPUnit\Session; | ||
|
||
|
||
use aik099\PHPUnit\BrowserTestCase; | ||
use Behat\Mink\Session; | ||
|
||
abstract class AbstractSessionStrategy implements ISessionStrategy | ||
{ | ||
|
||
/** | ||
* Determines if the session was just started. | ||
* | ||
* @var boolean|null | ||
*/ | ||
protected $isFreshSession; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function isFreshSession() | ||
{ | ||
return $this->isFreshSession; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function onTestEnded(BrowserTestCase $test_case) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function onTestFailed(BrowserTestCase $test_case, $exception) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function onTestSuiteEnded(BrowserTestCase $test_case) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Stops the session. | ||
* | ||
* @param Session|null $session Session. | ||
* | ||
* @return void | ||
*/ | ||
protected function stopSession(Session $session = null) | ||
{ | ||
if ( $session !== null && $session->isStarted() ) { | ||
$session->stop(); | ||
$this->isFreshSession = null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.