Skip to content

Commit

Permalink
Add missing setSessionId for cache purpose #117
Browse files Browse the repository at this point in the history
  • Loading branch information
johnzuk committed Jan 2, 2023
1 parent 5518a9f commit c9f386e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/GusApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public function testLoginWillSetSessionId(): void
self::assertSame('12sessionid21', $this->api->getSessionId());
}

public function testSetSessionIdWillSetSession(): void
{
$this->api->setSessionId("12sessionid21");
$this->mockApiClientGetValueCall('StatusSesji', '1');
self::assertTrue($this->api->isLogged());
}

public function testGetSessionIdFailsWhenNotLoggedIn(): void
{
$this->expectException(BadMethodCallException::class);
Expand Down Expand Up @@ -306,6 +313,11 @@ public function testGetSessionStatus(): void
private function expectGetValueCall(string $parameter, string $value): void
{
$this->loginApiWithSessionId('12sessionid21');
$this->mockApiClientGetValueCall($parameter, $value);
}

private function mockApiClientGetValueCall(string $parameter, string $value): void
{
$this->apiClient
->expects(self::once())
->method('getValue')
Expand Down

0 comments on commit c9f386e

Please sign in to comment.