| @@ 210-221 (lines=12) @@ | ||
| 207 | /** |
|
| 208 | * @expectedException \OCA\Encryption\Exceptions\PrivateKeyMissingException |
|
| 209 | */ |
|
| 210 | public function testUserHasKeysMissingPrivateKey() { |
|
| 211 | $this->keyStorageMock->expects($this->exactly(2)) |
|
| 212 | ->method('getUserKey') |
|
| 213 | ->willReturnCallback(function ($uid, $keyID, $encryptionModuleId) { |
|
| 214 | if ($keyID=== 'privateKey') { |
|
| 215 | return ''; |
|
| 216 | } |
|
| 217 | return 'key'; |
|
| 218 | }); |
|
| 219 | ||
| 220 | $this->instance->userHasKeys($this->userId); |
|
| 221 | } |
|
| 222 | ||
| 223 | /** |
|
| 224 | * @expectedException \OCA\Encryption\Exceptions\PublicKeyMissingException |
|
| @@ 226-238 (lines=13) @@ | ||
| 223 | /** |
|
| 224 | * @expectedException \OCA\Encryption\Exceptions\PublicKeyMissingException |
|
| 225 | */ |
|
| 226 | public function testUserHasKeysMissingPublicKey() { |
|
| 227 | $this->keyStorageMock->expects($this->exactly(2)) |
|
| 228 | ->method('getUserKey') |
|
| 229 | ->willReturnCallback(function ($uid, $keyID, $encryptionModuleId){ |
|
| 230 | if ($keyID === 'publicKey') { |
|
| 231 | return ''; |
|
| 232 | } |
|
| 233 | return 'key'; |
|
| 234 | }); |
|
| 235 | ||
| 236 | $this->instance->userHasKeys($this->userId); |
|
| 237 | ||
| 238 | } |
|
| 239 | ||
| 240 | /** |
|
| 241 | * @dataProvider dataTestInit |
|