Skip to content

Commit

Permalink
feat(ct-session): reset sessions #2
Browse files Browse the repository at this point in the history
  • Loading branch information
DumbergerL committed Jun 28, 2023
1 parent ef1d1ab commit c87fee3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CTSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ public static function getSessionIds(): array
$keysClient = array_keys(self::$ctConfigs);
return array_intersect($keysConfig, $keysClient);
}

public static function clearSessions()
{
self::$ctClients = [];
self::$ctConfigs = [];
}
}
6 changes: 6 additions & 0 deletions tests/Unit/CTSessionUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

class CTSessionUnitTest extends TestCaseHttpMocked
{
protected function setUp(): void
{
parent::setUp();
CTSession::clearSessions();
}

public function testSwitchSession()
{
$configDefault = CTConfig::getConfig();
Expand Down

0 comments on commit c87fee3

Please sign in to comment.