newRepo(); $repo->save($this->makeToken()); $found = $repo->findById('token-abc'); $this->assertSame('token-abc', $found->getId()); } public function testFindByIdThrowsWhenMissing(): void { $repo = $this->newRepo(); $this->expectException(RefreshTokenNotFoundException::class); $repo->findById('nope'); } public function testFindAllForDid(): void { $repo = $this->newRepo(); $repo->save($this->makeToken('t1', 'did:plc:alice')); $repo->save($this->makeToken('t2', 'did:plc:bob')); $results = $repo->findAllForDid('did:plc:alice'); $this->assertCount(1, $results); $this->assertSame('t1', $results[0]->getId()); } public function testDeleteAllForDid(): void { $repo = $this->newRepo(); $repo->save($this->makeToken('t1', 'did:plc:alice')); $repo->save($this->makeToken('t2', 'did:plc:alice')); $repo->deleteAllForDid('did:plc:alice'); $this->assertEmpty($repo->findAllForDid('did:plc:alice')); } }