Completed
Push — master ( f2603a...ee3a5e )
by Francesco
06:40 queued 31s
created
Tests/KeyManagerWrapperTest.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     public function testGenerateCreatesKey()
38 38
     {
39 39
         $this->keyManager->expects($this->once())
40
-                         ->method('generate')
41
-                         ->with(null)
42
-                         ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
40
+                            ->method('generate')
41
+                            ->with(null)
42
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
43 43
                                                         ->getMock()));
44 44
 
45 45
         $key = $this->wrapper->generate();
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
     {
55 55
         try {
56 56
             $this->keyManager->expects($this->once())
57
-                             ->method('generate')
58
-                             ->with(null)
59
-                             ->will($this->throwException(new EnvironmentIsBrokenException()));
57
+                                ->method('generate')
58
+                                ->with(null)
59
+                                ->will($this->throwException(new EnvironmentIsBrokenException()));
60 60
         } catch (EnvironmentIsBrokenException $ex) {
61 61
             $this->throwException(new CryptoException());
62 62
         }
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
         $secret = 'ThisIsASecretPassword';
71 71
 
72 72
         $this->keyManager->expects($this->once())
73
-                         ->method('generateFromAscii')
74
-                         ->with($key_encoded, $secret)
75
-                         ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
73
+                            ->method('generateFromAscii')
74
+                            ->with($key_encoded, $secret)
75
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
76 76
                                                         ->getMock()));
77 77
 
78 78
         $key = $this->wrapper->generateFromAscii($key_encoded, $secret);
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 
91 91
         try {
92 92
             $this->keyManager->expects($this->once())
93
-                             ->method('generateFromAscii')
94
-                             ->with($key_encoded, $secret)
95
-                             ->will($this->throwException(new BaseCryptoException()));
93
+                                ->method('generateFromAscii')
94
+                                ->with($key_encoded, $secret)
95
+                                ->will($this->throwException(new BaseCryptoException()));
96 96
         } catch (CryptoException $ex) {
97 97
             $this->throwException(new CryptoException());
98 98
         }
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
     public function testGetKeyReadsKey()
104 104
     {
105 105
         $this->keyManager->expects($this->once())
106
-                         ->method('getKey')
107
-                         ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
106
+                            ->method('getKey')
107
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
108 108
                                                         ->getMock()));
109 109
 
110 110
         $key = $this->wrapper->getKey();
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
     public function testSetKeyStoresKey()
116 116
     {
117 117
         $this->keyManager->expects($this->once())
118
-                         ->method('setKey')
119
-                         ->with($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
120
-                                     ->getMock());
118
+                            ->method('setKey')
119
+                            ->with($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
120
+                                        ->getMock());
121 121
 
122 122
         $this->wrapper->setKey($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
123 123
                                     ->getMock());
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
     public function testSetSecretStoresSecret()
127 127
     {
128 128
         $this->keyManager->expects($this->once())
129
-                         ->method('setSecret')
130
-                         ->with('ThisIsASecret');
129
+                            ->method('setSecret')
130
+                            ->with('ThisIsASecret');
131 131
 
132 132
         $this->wrapper->setSecret('ThisIsASecret');
133 133
     }
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
     public function testGetSecretReadsSecret()
136 136
     {
137 137
         $this->keyManager->expects($this->once())
138
-                         ->method('getSecret')
139
-                         ->will($this->returnValue('ThisIsYourSecret'));
138
+                            ->method('getSecret')
139
+                            ->will($this->returnValue('ThisIsYourSecret'));
140 140
 
141 141
         $secret = $this->wrapper->getSecret();
142 142
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     protected function setUp()
147 147
     {
148 148
         $this->keyManager = $this->getMockBuilder('\Mes\Security\CryptoBundle\KeyManagerInterface')
149
-                                 ->getMock();
149
+                                    ->getMock();
150 150
         $this->wrapper = new KeyManagerWrapper($this->keyManager);
151 151
     }
152 152
 
Please login to merge, or discard this patch.
Tests/KeyManagerTest.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     public function testGenerateCreatesKey()
38 38
     {
39 39
         $this->keyGenerator->expects($this->once())
40
-                           ->method('generate')
41
-                           ->with(null)
42
-                           ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
43
-                                                          ->getMock()));
40
+                            ->method('generate')
41
+                            ->with(null)
42
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
43
+                                                            ->getMock()));
44 44
 
45 45
         $key = $this->keyManager->generate();
46 46
 
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
         $secret = 'ThisIsASecretPassword';
54 54
 
55 55
         $this->keyGenerator->expects($this->once())
56
-                           ->method('generateFromAscii')
57
-                           ->with($key_encoded, $secret)
58
-                           ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
59
-                                                          ->getMock()));
56
+                            ->method('generateFromAscii')
57
+                            ->with($key_encoded, $secret)
58
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
59
+                                                            ->getMock()));
60 60
 
61 61
         $key = $this->keyManager->generateFromAscii($key_encoded, $secret);
62 62
 
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
     public function testGetKeyReadsNotExistingKey()
67 67
     {
68 68
         $this->keyStorage->expects($this->once())
69
-                         ->method('getKey')
70
-                         ->will($this->returnValue(null));
69
+                            ->method('getKey')
70
+                            ->will($this->returnValue(null));
71 71
 
72 72
         $this->keyGenerator->expects($this->once())
73
-                           ->method('generate')
74
-                           ->with(null)
75
-                           ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
76
-                                                          ->getMock()));
73
+                            ->method('generate')
74
+                            ->with(null)
75
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
76
+                                                            ->getMock()));
77 77
 
78 78
         $this->keyStorage->expects($this->once())
79
-                         ->method('setKey');
79
+                            ->method('setKey');
80 80
 
81 81
         $key = $this->keyManager->getKey();
82 82
 
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
     public function testGetKeyReadsExistingKey()
87 87
     {
88 88
         $this->keyStorage->expects($this->never())
89
-                         ->method('setKey');
89
+                            ->method('setKey');
90 90
 
91 91
         $this->keyGenerator->expects($this->never())
92
-                           ->method('generate');
92
+                            ->method('generate');
93 93
 
94 94
         $this->keyStorage->expects($this->once())
95
-                         ->method('getKey')
96
-                         ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
95
+                            ->method('getKey')
96
+                            ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
97 97
                                                         ->getMock()));
98 98
 
99 99
         $key = $this->keyManager->getKey();
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
     public function testSetKeyStoresKey()
105 105
     {
106 106
         $this->keyStorage->expects($this->once())
107
-                         ->method('setKey')
108
-                         ->with($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
109
-                                     ->getMock());
107
+                            ->method('setKey')
108
+                            ->with($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
109
+                                        ->getMock());
110 110
 
111 111
         $this->keyManager->setKey($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
112
-                                       ->getMock());
112
+                                        ->getMock());
113 113
     }
114 114
 
115 115
     public function testSetSecretStoreSecret()
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
     protected function setUp()
123 123
     {
124 124
         $this->keyStorage = $this->getMockBuilder('Mes\Security\CryptoBundle\KeyStorage\KeyStorageInterface')
125
-                                 ->getMock();
125
+                                    ->getMock();
126 126
 
127 127
         $this->keyGenerator = $this->getMockBuilder('Mes\Security\CryptoBundle\KeyGenerator\KeyGeneratorInterface')
128
-                                   ->getMock();
128
+                                    ->getMock();
129 129
 
130 130
         $this->keyManager = new KeyManager($this->keyStorage, $this->keyGenerator);
131 131
     }
Please login to merge, or discard this patch.