From c9f386e33a42b0a0f70c44628886b78df1336d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janusz=20=C5=BBukowicz?= Date: Mon, 2 Jan 2023 16:40:44 +0100 Subject: [PATCH] Add missing setSessionId for cache purpose #117 --- tests/GusApiTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/GusApiTest.php b/tests/GusApiTest.php index 9fc738f..259818a 100644 --- a/tests/GusApiTest.php +++ b/tests/GusApiTest.php @@ -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); @@ -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')