/** * remove recovery key to all encrypted files * @param string $path */ private function removeRecoveryKeys($path) { $dirContent = $this->view->getDirectoryContent($path); foreach ($dirContent as $item) { $filePath = $item->getPath(); if ($item['type'] === 'dir') { $this->removeRecoveryKeys($filePath . '/'); } else { $this->keyManager->deleteShareKey($filePath, $this->keyManager->getRecoveryKeyId()); } } }
public function testDeleteShareKey() { $this->keyStorageMock->expects($this->any())->method('deleteFileKey')->with($this->equalTo('/path'), $this->equalTo('keyId.shareKey'))->willReturn(true); $this->assertTrue($this->instance->deleteShareKey('/path', 'keyId')); }