nextcloud/tests/lib/Session/CryptoSessionHandlerTest.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
763 B
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
/*
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Tests\Session;
use OC\Session\CryptoSessionHandler;
use Test\TestCase;
/**
* @covers \OC\Session\CryptoSessionHandler
*/
class CryptoSessionHandlerTest extends TestCase {
public function testParseIdWithPassphrase(): void {
[$sessionId, $passphrase] = CryptoSessionHandler::parseId('abc|def');
self::assertEquals('abc', $sessionId);
self::assertEquals('def', $passphrase);
}
public function testParseIdWithoutPassphrase(): void {
[$sessionId, $passphrase] = CryptoSessionHandler::parseId('abc');
self::assertEquals('abc', $sessionId);
self::assertNull($passphrase);
}
}