Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031<?php
declare(strict_types=1);
namespace Wotnak\Atproto\Tests\Unit;
use PHPUnit\Framework\TestCase;use Wotnak\Atproto\Cache\CacheKey;
final class CacheKeyTest extends TestCase {
public function testBuildReturnsPortableKey(): void { $key = CacheKey::build('oauth:did/{tenant}', 'did:plc:abc');
static::assertSame(64, \strlen($key)); static::assertMatchesRegularExpression('/^[a-f0-9]{64}$/D', $key); }
public function testBuildSeparatesNamespaceAndValue(): void { static::assertNotSame( CacheKey::build('ab', 'c'), CacheKey::build('a', 'bc'), ); static::assertNotSame( CacheKey::build('a', "b\0c"), CacheKey::build("a\0b", 'c'), ); }
}