newRepo(); $repo->save($this->makeBlob()); $found = $repo->findByCid('bafyreib'); $this->assertSame('bafyreib', $found->getCid()); } public function testFindByCidThrowsWhenMissing(): void { $repo = $this->newRepo(); $this->expectException(BlobNotFoundException::class); $repo->findByCid('nope'); } public function testFindTemporary(): void { $repo = $this->newRepo(); $repo->save($this->makeBlob(cid: 'cid1', tempKey: null)); $repo->save($this->makeBlob(cid: 'cid2', tempKey: 'tmpkey123')); $temps = $repo->findTemporary(); $this->assertCount(1, $temps); $this->assertSame('cid2', $temps[0]->getCid()); } public function testFindAll(): void { $repo = $this->newRepo(); $repo->save($this->makeBlob(cid: 'c1')); $repo->save($this->makeBlob(cid: 'c2')); $this->assertCount(2, $repo->findAll()); } public function testDeleteAll(): void { $repo = $this->newRepo(); $repo->save($this->makeBlob(cid: 'c1')); $repo->save($this->makeBlob(cid: 'c2')); $repo->deleteAll(); $this->assertEmpty($repo->findAll()); } }