expectException(InvalidArgumentException::class); SessionManager::createSession($publicKey); } public function testCreateSession(): void { $keyPair = Cryptography::generateKeyPair(); $uuid = SessionManager::createSession($keyPair->getPublicKey()); $this->assertTrue(SessionManager::sessionExists($uuid)); } public function testGetSessionWithInvalidUuid(): void { $uuid = 'invalid_uuid'; $this->expectException(DatabaseOperationException::class); SessionManager::getSession($uuid); } public function testGetSessionWithValidUuid(): void { $keyPair = Cryptography::generateKeyPair(); $uuid = SessionManager::createSession($keyPair->getPublicKey()); $session = SessionManager::getSession($uuid); $this->assertInstanceOf(SessionRecord::class, $session); $this->assertEquals($uuid, $session->getUuid()); $this->assertEquals($keyPair->getPublicKey(), Utilities::base64encode($session->getPublicKey())); } }