@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * @param $question |
|
78 | - * @param $default |
|
77 | + * @param string $question |
|
78 | + * @param string $default |
|
79 | 79 | * @param string $sep |
80 | 80 | * |
81 | 81 | * @return string |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | /** |
92 | 92 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
93 | - * @param $text |
|
93 | + * @param string $text |
|
94 | 94 | * @param string $style |
95 | 95 | */ |
96 | 96 | protected function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white') |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * @param $text |
|
113 | - * @param $style |
|
112 | + * @param string $text |
|
113 | + * @param string $style |
|
114 | 114 | * |
115 | 115 | * @return string |
116 | 116 | */ |
@@ -99,7 +99,7 @@ |
||
99 | 99 | * @var FormatterHelper |
100 | 100 | */ |
101 | 101 | $formatter = $this->getHelperSet() |
102 | - ->get('formatter'); |
|
102 | + ->get('formatter'); |
|
103 | 103 | |
104 | 104 | $output->writeln(array( |
105 | 105 | '', |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | // rawKey is locked and become instance of \Defuse\Crypto\Key. |
94 | 94 | $this->rawKey = $this->getRawKey() |
95 | - ->unlockKey($this->getSecret()); |
|
95 | + ->unlockKey($this->getSecret()); |
|
96 | 96 | |
97 | 97 | return $this; |
98 | 98 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | protected function configure() |
27 | 27 | { |
28 | 28 | $this->setName('mes:crypto:generate-secret') |
29 | - ->setDescription('Generates an authentication secret') |
|
30 | - ->setHelp(<<<'EOF' |
|
29 | + ->setDescription('Generates an authentication secret') |
|
30 | + ->setHelp(<<<'EOF' |
|
31 | 31 | The <info>%command.name%</info> generates an authentication secret. |
32 | 32 | |
33 | 33 | <info>%command.full_name%</info> |
34 | 34 | EOF |
35 | - ); |
|
35 | + ); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ->info('Encoded key or path to .crypto file. If key is null, it generates a different random key for each request.') |
42 | 42 | ->beforeNormalization() |
43 | 43 | ->ifString() |
44 | - ->then(function ($v) { |
|
44 | + ->then(function($v) { |
|
45 | 45 | if (is_file($v) && is_readable($v)) { |
46 | 46 | return array('path' => $v); |
47 | 47 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ->end() |
52 | 52 | ->validate() |
53 | 53 | ->ifArray() |
54 | - ->then(function ($v) { |
|
54 | + ->then(function($v) { |
|
55 | 55 | $path = $v['path']; |
56 | 56 | $key = $v['key']; |
57 | 57 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $rootNode = $treeBuilder->root('mes_crypto'); |
30 | 30 | |
31 | 31 | $rootNode |
32 | - ->children() |
|
32 | + ->children() |
|
33 | 33 | ->arrayNode('key') |
34 | 34 | ->addDefaultsIfNotSet() |
35 | 35 | ->children() |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ->info('your_loader_service_id. Disabled by default. To enabled: loader: ~') |
102 | 102 | ->canBeEnabled() |
103 | 103 | ->end() |
104 | - ->end() |
|
104 | + ->end() |
|
105 | 105 | ; |
106 | 106 | |
107 | 107 | return $treeBuilder; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $this->keyStorage->setKey($key); |
35 | 35 | |
36 | 36 | $this->assertInstanceOf('Defuse\Crypto\KeyProtectedByPassword', $this->keyStorage->getKey() |
37 | - ->getRawKey()); |
|
37 | + ->getRawKey()); |
|
38 | 38 | $this->assertSame($secret, $this->keyStorage->getKey() |
39 | 39 | ->getSecret()); |
40 | 40 | } |
@@ -49,6 +49,6 @@ |
||
49 | 49 | private function unlockKey(Key $key) |
50 | 50 | { |
51 | 51 | return $key->unlock() |
52 | - ->getRawKey(); |
|
52 | + ->getRawKey(); |
|
53 | 53 | } |
54 | 54 | } |
@@ -158,7 +158,7 @@ |
||
158 | 158 | /** |
159 | 159 | * @param Key|KeyInterface $key The KeyInterface instance to unlock used for Defuse encryption system |
160 | 160 | * |
161 | - * @return \Defuse\Crypto\Key|\Defuse\Crypto\KeyProtectedByPassword The Defuse key |
|
161 | + * @return \Defuse\Crypto\Key The Defuse key |
|
162 | 162 | */ |
163 | 163 | private function unlockKey(Key $key) |
164 | 164 | { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $this->encryption->expects($this->once()) |
120 | 120 | ->method('encryptFileWithKey') |
121 | - ->will($this->returnCallback(function ($input, $output) { |
|
121 | + ->will($this->returnCallback(function($input, $output) { |
|
122 | 122 | $fs = new Filesystem(); |
123 | 123 | $fs->dumpFile($output, ''); |
124 | 124 | })); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | { |
138 | 138 | $this->encryption->expects($this->once()) |
139 | 139 | ->method('decryptFileWithKey') |
140 | - ->will($this->returnCallback(function ($input, $output) { |
|
140 | + ->will($this->returnCallback(function($input, $output) { |
|
141 | 141 | $fs = new Filesystem(); |
142 | 142 | $fs->dumpFile($output, 'Plain text'); |
143 | 143 | })); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $this->encryption->expects($this->once()) |
246 | 246 | ->method('encryptFileWithPassword') |
247 | - ->will($this->returnCallback(function ($input, $output, $password) { |
|
247 | + ->will($this->returnCallback(function($input, $output, $password) { |
|
248 | 248 | $fs = new Filesystem(); |
249 | 249 | $fs->dumpFile($output, ''); |
250 | 250 | })); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | $this->encryption->expects($this->once()) |
278 | 278 | ->method('decryptFileWithPassword') |
279 | - ->will($this->returnCallback(function ($input, $output, $password) { |
|
279 | + ->will($this->returnCallback(function($input, $output, $password) { |
|
280 | 280 | $fs = new Filesystem(); |
281 | 281 | $fs->dumpFile($output, 'Plain text'); |
282 | 282 | })); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | protected function setUp() |
37 | 37 | { |
38 | 38 | $this->encryption = $this->getMockBuilder('Mes\Security\CryptoBundle\EncryptionInterface') |
39 | - ->getMock(); |
|
39 | + ->getMock(); |
|
40 | 40 | $this->wrapper = new EncryptionWrapper($this->encryption); |
41 | 41 | } |
42 | 42 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | public function testEncryptWithKeyEncryptsPlaintext() |
60 | 60 | { |
61 | 61 | $this->encryption->expects($this->once()) |
62 | - ->method('encryptWithKey') |
|
63 | - ->with('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
62 | + ->method('encryptWithKey') |
|
63 | + ->with('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
64 | 64 | ->getMock()) |
65 | - ->will($this->returnValue('ThisIsACipherText')); |
|
65 | + ->will($this->returnValue('ThisIsACipherText')); |
|
66 | 66 | |
67 | 67 | $ciphertext = $this->wrapper->encryptWithKey('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
68 | - ->getMock()); |
|
68 | + ->getMock()); |
|
69 | 69 | |
70 | 70 | $this->assertTrue(ctype_print($ciphertext), 'is printable'); |
71 | 71 | } |
@@ -77,16 +77,16 @@ discard block |
||
77 | 77 | { |
78 | 78 | try { |
79 | 79 | $this->encryption->expects($this->once()) |
80 | - ->method('encryptWithKey') |
|
81 | - ->with('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
80 | + ->method('encryptWithKey') |
|
81 | + ->with('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
82 | 82 | ->getMock()) |
83 | - ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
83 | + ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
84 | 84 | } catch (EnvironmentIsBrokenException $e) { |
85 | 85 | $this->throwException(new CryptoException()); |
86 | 86 | } |
87 | 87 | |
88 | 88 | $this->wrapper->encryptWithKey('The quick brown fox jumps over the lazy dog', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
89 | - ->getMock()); |
|
89 | + ->getMock()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | public function testDecryptWithKeyDecryptsCiphertext() |
96 | 96 | { |
97 | 97 | $this->encryption->expects($this->once()) |
98 | - ->method('decryptWithKey') |
|
99 | - ->with('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
100 | - ->getMock()) |
|
101 | - ->will($this->returnValue('The quick brown fox jumps over the lazy dog')); |
|
98 | + ->method('decryptWithKey') |
|
99 | + ->with('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
100 | + ->getMock()) |
|
101 | + ->will($this->returnValue('The quick brown fox jumps over the lazy dog')); |
|
102 | 102 | |
103 | 103 | $decryptedText = $this->wrapper->decryptWithKey('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
104 | - ->getMock()); |
|
104 | + ->getMock()); |
|
105 | 105 | |
106 | 106 | $this->assertSame('The quick brown fox jumps over the lazy dog', $decryptedText); |
107 | 107 | } |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | { |
114 | 114 | try { |
115 | 115 | $this->encryption->expects($this->once()) |
116 | - ->method('decryptWithKey') |
|
117 | - ->with('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
118 | - ->getMock()) |
|
119 | - ->will($this->throwException(new BaseCryptoException())); |
|
116 | + ->method('decryptWithKey') |
|
117 | + ->with('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
118 | + ->getMock()) |
|
119 | + ->will($this->throwException(new BaseCryptoException())); |
|
120 | 120 | } catch (BaseCryptoException $e) { |
121 | 121 | $this->throwException(new CryptoException()); |
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->wrapper->decryptWithKey('ThisIsACipherText', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
125 | - ->getMock()); |
|
125 | + ->getMock()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /* ======================================= |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | public function testEncryptFileWithKeyEncryptsFile() |
139 | 139 | { |
140 | 140 | $this->encryption->expects($this->once()) |
141 | - ->method('encryptFileWithKey') |
|
142 | - ->will($this->returnCallback(function ($input, $output) { |
|
143 | - $fs = new Filesystem(); |
|
144 | - $fs->dumpFile($output, ''); |
|
145 | - })); |
|
141 | + ->method('encryptFileWithKey') |
|
142 | + ->will($this->returnCallback(function ($input, $output) { |
|
143 | + $fs = new Filesystem(); |
|
144 | + $fs->dumpFile($output, ''); |
|
145 | + })); |
|
146 | 146 | |
147 | 147 | $this->wrapper->encryptFileWithKey(__DIR__.'/file.txt', __DIR__.'/file.crypto', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
148 | - ->getMock()); |
|
148 | + ->getMock()); |
|
149 | 149 | |
150 | 150 | $this->assertFileExists(__DIR__.'/file.crypto'); |
151 | 151 | |
@@ -158,14 +158,14 @@ discard block |
||
158 | 158 | public function testDecryptFileWithKeyDecryptsEncryptedFile() |
159 | 159 | { |
160 | 160 | $this->encryption->expects($this->once()) |
161 | - ->method('decryptFileWithKey') |
|
162 | - ->will($this->returnCallback(function ($input, $output) { |
|
163 | - $fs = new Filesystem(); |
|
164 | - $fs->dumpFile($output, 'Plain text'); |
|
165 | - })); |
|
161 | + ->method('decryptFileWithKey') |
|
162 | + ->will($this->returnCallback(function ($input, $output) { |
|
163 | + $fs = new Filesystem(); |
|
164 | + $fs->dumpFile($output, 'Plain text'); |
|
165 | + })); |
|
166 | 166 | |
167 | 167 | $this->wrapper->decryptFileWithKey(__DIR__.'/file.crypto', __DIR__.'/file.txt', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
168 | - ->getMock()); |
|
168 | + ->getMock()); |
|
169 | 169 | |
170 | 170 | $this->assertFileExists(__DIR__.'/file.txt'); |
171 | 171 | $this->assertContains('Plain text', file_get_contents(__DIR__.'/file.txt')); |
@@ -180,14 +180,14 @@ discard block |
||
180 | 180 | { |
181 | 181 | try { |
182 | 182 | $this->encryption->expects($this->once()) |
183 | - ->method('encryptFileWithKey') |
|
184 | - ->will($this->throwException(new BaseCryptoException())); |
|
183 | + ->method('encryptFileWithKey') |
|
184 | + ->will($this->throwException(new BaseCryptoException())); |
|
185 | 185 | } catch (BaseCryptoException $e) { |
186 | 186 | $this->throwException(new CryptoException()); |
187 | 187 | } |
188 | 188 | |
189 | 189 | $this->wrapper->encryptFileWithKey(__DIR__.'/file.txt', __DIR__.'/file.crypto', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
190 | - ->getMock()); |
|
190 | + ->getMock()); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -197,14 +197,14 @@ discard block |
||
197 | 197 | { |
198 | 198 | try { |
199 | 199 | $this->encryption->expects($this->once()) |
200 | - ->method('decryptFileWithKey') |
|
201 | - ->will($this->throwException(new BaseCryptoException())); |
|
200 | + ->method('decryptFileWithKey') |
|
201 | + ->will($this->throwException(new BaseCryptoException())); |
|
202 | 202 | } catch (BaseCryptoException $e) { |
203 | 203 | $this->throwException(new CryptoException()); |
204 | 204 | } |
205 | 205 | |
206 | 206 | $this->wrapper->decryptFileWithKey(__DIR__.'/file.crypto', __DIR__.'/file.txt', $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
207 | - ->getMock()); |
|
207 | + ->getMock()); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /* ======================================== |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | public function testEncryptWithPasswordEncryptsPlaintext() |
218 | 218 | { |
219 | 219 | $this->encryption->expects($this->once()) |
220 | - ->method('encryptWithPassword') |
|
221 | - ->with('The quick brown fox jumps over the lazy dog', 'SuperSecretPa$$word') |
|
222 | - ->will($this->returnValue('ThisIsACipherText')); |
|
220 | + ->method('encryptWithPassword') |
|
221 | + ->with('The quick brown fox jumps over the lazy dog', 'SuperSecretPa$$word') |
|
222 | + ->will($this->returnValue('ThisIsACipherText')); |
|
223 | 223 | |
224 | 224 | $ciphertext = $this->wrapper->encryptWithPassword('The quick brown fox jumps over the lazy dog', 'SuperSecretPa$$word'); |
225 | 225 | |
@@ -233,9 +233,9 @@ discard block |
||
233 | 233 | { |
234 | 234 | try { |
235 | 235 | $this->encryption->expects($this->once()) |
236 | - ->method('encryptWithPassword') |
|
237 | - ->with('The quick brown fox jumps over the lazy dog', 'SuperSecretPa$$word') |
|
238 | - ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
236 | + ->method('encryptWithPassword') |
|
237 | + ->with('The quick brown fox jumps over the lazy dog', 'SuperSecretPa$$word') |
|
238 | + ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
239 | 239 | } catch (EnvironmentIsBrokenException $e) { |
240 | 240 | $this->throwException(new CryptoException()); |
241 | 241 | } |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | public function testDecryptWithPasswordDecryptsCiphertext() |
247 | 247 | { |
248 | 248 | $this->encryption->expects($this->once()) |
249 | - ->method('decryptWithPassword') |
|
250 | - ->with('ThisIsACipherText', 'SuperSecretPa$$word') |
|
251 | - ->will($this->returnValue('The quick brown fox jumps over the lazy dog')); |
|
249 | + ->method('decryptWithPassword') |
|
250 | + ->with('ThisIsACipherText', 'SuperSecretPa$$word') |
|
251 | + ->will($this->returnValue('The quick brown fox jumps over the lazy dog')); |
|
252 | 252 | |
253 | 253 | $decryptedText = $this->wrapper->decryptWithPassword('ThisIsACipherText', 'SuperSecretPa$$word'); |
254 | 254 | |
@@ -262,9 +262,9 @@ discard block |
||
262 | 262 | { |
263 | 263 | try { |
264 | 264 | $this->encryption->expects($this->once()) |
265 | - ->method('decryptWithPassword') |
|
266 | - ->with('ThisIsACipherText', 'SuperSecretPa$$word') |
|
267 | - ->will($this->throwException(new WrongKeyOrModifiedCiphertextException())); |
|
265 | + ->method('decryptWithPassword') |
|
266 | + ->with('ThisIsACipherText', 'SuperSecretPa$$word') |
|
267 | + ->will($this->throwException(new WrongKeyOrModifiedCiphertextException())); |
|
268 | 268 | } catch (BaseCryptoException $e) { |
269 | 269 | $this->throwException(new CryptoException()); |
270 | 270 | } |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | public function testEncryptFileWithPasswordEncryptsFile() |
283 | 283 | { |
284 | 284 | $this->encryption->expects($this->once()) |
285 | - ->method('encryptFileWithPassword') |
|
286 | - ->will($this->returnCallback(function ($input, $output, $password) { |
|
287 | - $fs = new Filesystem(); |
|
288 | - $fs->dumpFile($output, ''); |
|
289 | - })); |
|
285 | + ->method('encryptFileWithPassword') |
|
286 | + ->will($this->returnCallback(function ($input, $output, $password) { |
|
287 | + $fs = new Filesystem(); |
|
288 | + $fs->dumpFile($output, ''); |
|
289 | + })); |
|
290 | 290 | |
291 | 291 | $this->wrapper->encryptFileWithPassword(__DIR__.'/file.txt', __DIR__.'/file.crypto', 'SuperSecretPa$$word'); |
292 | 292 | |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | { |
303 | 303 | try { |
304 | 304 | $this->encryption->expects($this->once()) |
305 | - ->method('encryptFileWithPassword') |
|
306 | - ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
305 | + ->method('encryptFileWithPassword') |
|
306 | + ->will($this->throwException(new EnvironmentIsBrokenException())); |
|
307 | 307 | } catch (EnvironmentIsBrokenException $e) { |
308 | 308 | $this->throwException(new CryptoException()); |
309 | 309 | } |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | public function testDecryptFileWithPasswordDecryptsEncryptedFile() |
315 | 315 | { |
316 | 316 | $this->encryption->expects($this->once()) |
317 | - ->method('decryptFileWithPassword') |
|
318 | - ->will($this->returnCallback(function ($input, $output, $password) { |
|
319 | - $fs = new Filesystem(); |
|
320 | - $fs->dumpFile($output, 'Plain text'); |
|
321 | - })); |
|
317 | + ->method('decryptFileWithPassword') |
|
318 | + ->will($this->returnCallback(function ($input, $output, $password) { |
|
319 | + $fs = new Filesystem(); |
|
320 | + $fs->dumpFile($output, 'Plain text'); |
|
321 | + })); |
|
322 | 322 | |
323 | 323 | $this->wrapper->decryptFileWithPassword(__DIR__.'/file.crypto', __DIR__.'/file.txt', 'SuperSecretPa$$word'); |
324 | 324 | |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | { |
336 | 336 | try { |
337 | 337 | $this->encryption->expects($this->once()) |
338 | - ->method('decryptFileWithPassword') |
|
339 | - ->will($this->throwException(new WrongKeyOrModifiedCiphertextException())); |
|
338 | + ->method('decryptFileWithPassword') |
|
339 | + ->will($this->throwException(new WrongKeyOrModifiedCiphertextException())); |
|
340 | 340 | } catch (BaseCryptoException $e) { |
341 | 341 | $this->throwException(new CryptoException()); |
342 | 342 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -register_shutdown_function(function () { |
|
12 | +register_shutdown_function(function() { |
|
13 | 13 | if (file_exists(__DIR__.'/key.crypto')) { |
14 | 14 | unlink(__DIR__.'/key.crypto'); |
15 | 15 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | protected function setUp() |
34 | 34 | { |
35 | 35 | $this->encryption = $this->getMockBuilder('Mes\Security\CryptoBundle\EncryptionInterface') |
36 | - ->getMock(); |
|
36 | + ->getMock(); |
|
37 | 37 | $this->wrapper = new EncryptionWrapper($this->encryption); |
38 | 38 | } |
39 | 39 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function testEncryptResourceWithKeyEncryptsHandle() |
57 | 57 | { |
58 | 58 | $this->encryption->expects($this->once()) |
59 | - ->method('encryptResourceWithKey'); |
|
59 | + ->method('encryptResourceWithKey'); |
|
60 | 60 | |
61 | 61 | $this->wrapper->encryptResourceWithKey(fopen('php://stdin', 'r'), fopen('php://memory', 'wb'), $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
62 | 62 | ->getMock()); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function testDecryptResourceWithKeyDecryptsEncryptedHandle() |
69 | 69 | { |
70 | 70 | $this->encryption->expects($this->once()) |
71 | - ->method('decryptResourceWithKey'); |
|
71 | + ->method('decryptResourceWithKey'); |
|
72 | 72 | |
73 | 73 | $this->wrapper->decryptResourceWithKey(fopen('php://stdin', 'r'), fopen('php://memory', 'wb'), $this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
74 | 74 | ->getMock()); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | { |
82 | 82 | try { |
83 | 83 | $this->encryption->expects($this->once()) |
84 | - ->method('encryptResourceWithKey') |
|
85 | - ->will($this->throwException(new BaseCryptoException())); |
|
84 | + ->method('encryptResourceWithKey') |
|
85 | + ->will($this->throwException(new BaseCryptoException())); |
|
86 | 86 | } catch (BaseCryptoException $e) { |
87 | 87 | $this->throwException(new CryptoException()); |
88 | 88 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | { |
99 | 99 | try { |
100 | 100 | $this->encryption->expects($this->once()) |
101 | - ->method('decryptResourceWithKey') |
|
102 | - ->will($this->throwException(new BaseCryptoException())); |
|
101 | + ->method('decryptResourceWithKey') |
|
102 | + ->will($this->throwException(new BaseCryptoException())); |
|
103 | 103 | } catch (BaseCryptoException $e) { |
104 | 104 | $this->throwException(new CryptoException()); |
105 | 105 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function testEncryptResourceWithPasswordEncryptsHandle() |
122 | 122 | { |
123 | 123 | $this->encryption->expects($this->once()) |
124 | - ->method('encryptResourceWithPassword'); |
|
124 | + ->method('encryptResourceWithPassword'); |
|
125 | 125 | |
126 | 126 | $this->wrapper->encryptResourceWithPassword(fopen('php://stdin', 'r'), fopen('php://memory', 'wb'), 'SecretPa$$word'); |
127 | 127 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function testDecryptResourceWithPasswordDecryptsEncryptedHandle() |
133 | 133 | { |
134 | 134 | $this->encryption->expects($this->once()) |
135 | - ->method('decryptResourceWithPassword'); |
|
135 | + ->method('decryptResourceWithPassword'); |
|
136 | 136 | |
137 | 137 | $this->wrapper->decryptResourceWithPassword(fopen('php://stdin', 'r'), fopen('php://memory', 'wb'), 'SecretPa$$word'); |
138 | 138 | } |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | { |
145 | 145 | try { |
146 | 146 | $this->encryption->expects($this->once()) |
147 | - ->method('encryptResourceWithPassword') |
|
148 | - ->will($this->throwException(new BaseCryptoException())); |
|
147 | + ->method('encryptResourceWithPassword') |
|
148 | + ->will($this->throwException(new BaseCryptoException())); |
|
149 | 149 | } catch (BaseCryptoException $e) { |
150 | 150 | $this->throwException(new CryptoException()); |
151 | 151 | } |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | { |
161 | 161 | try { |
162 | 162 | $this->encryption->expects($this->once()) |
163 | - ->method('decryptResourceWithPassword') |
|
164 | - ->will($this->throwException(new BaseCryptoException())); |
|
163 | + ->method('decryptResourceWithPassword') |
|
164 | + ->will($this->throwException(new BaseCryptoException())); |
|
165 | 165 | } catch (BaseCryptoException $e) { |
166 | 166 | $this->throwException(new CryptoException()); |
167 | 167 | } |