Code Duplication    Length = 9-11 lines in 4 locations

apps/encryption/tests/lib/KeyManagerTest.php 4 locations

@@ 97-106 (lines=10) @@
94
			$this->utilMock);
95
	}
96
97
	public function testDeleteShareKey() {
98
		$this->keyStorageMock->expects($this->any())
99
			->method('deleteFileKey')
100
			->with($this->equalTo('/path'), $this->equalTo('keyId.shareKey'))
101
			->willReturn(true);
102
103
		$this->assertTrue(
104
			$this->instance->deleteShareKey('/path', 'keyId')
105
		);
106
	}
107
108
	public function testGetPrivateKey() {
109
		$this->keyStorageMock->expects($this->any())
@@ 132-140 (lines=9) @@
129
		);
130
	}
131
132
	public function testRecoveryKeyExists() {
133
		$this->keyStorageMock->expects($this->any())
134
			->method('getSystemUserKey')
135
			->with($this->equalTo($this->systemKeyId . '.publicKey'))
136
			->willReturn('recoveryKey');
137
138
139
		$this->assertTrue($this->instance->recoveryKeyExists());
140
	}
141
142
	public function testCheckRecoveryKeyPassword() {
143
		$this->keyStorageMock->expects($this->any())
@@ 312-322 (lines=11) @@
309
		);
310
	}
311
312
	public function testSetSystemPrivateKey() {
313
		$this->keyStorageMock->expects($this->exactly(1))
314
			->method('setSystemUserKey')
315
			->with($this->equalTo('keyId.privateKey'), $this->equalTo('key'))
316
			->willReturn(true);
317
318
319
		$this->assertTrue(
320
			$this->instance->setSystemPrivateKey('keyId', 'key')
321
		);
322
	}
323
324
	public function testGetSystemPrivateKey() {
325
		$this->keyStorageMock->expects($this->exactly(1))
@@ 324-334 (lines=11) @@
321
		);
322
	}
323
324
	public function testGetSystemPrivateKey() {
325
		$this->keyStorageMock->expects($this->exactly(1))
326
			->method('getSystemUserKey')
327
			->with($this->equalTo('keyId.privateKey'))
328
			->willReturn('systemPrivateKey');
329
330
331
		$this->assertSame('systemPrivateKey',
332
			$this->instance->getSystemPrivateKey('keyId')
333
		);
334
	}
335
336
	public function testGetEncryptedFileKey() {
337
		$this->keyStorageMock->expects($this->once())