Completed
Push — develop ( a73e2c...030f10 )
by Carsten
28:43 queued 13:31
created
Factory/EventManager/EventManagerAbstractFactory/CreateEventManagerTest.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     protected function setUp()
42 42
     {
43 43
         $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory')
44
-                             ->setMethods([ 'attachListeners', 'getConfig' ])
45
-                             ->getMock();
44
+                                ->setMethods([ 'attachListeners', 'getConfig' ])
45
+                                ->getMock();
46 46
     }
47 47
 
48 48
     protected function setTargetConfig($config)
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
     protected function getServiceManagerMock($events, $args = [])
70 70
     {
71 71
         $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')
72
-                         ->disableOriginalConstructor()
73
-                         ->getMock();
72
+                            ->disableOriginalConstructor()
73
+                            ->getMock();
74 74
 
75 75
 
76 76
         if (is_Array($events)) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             ->will($this->returnValueMap($hasMap))
102 102
         ;
103 103
         $services->expects($this->exactly(count($getMap)))
104
-                 ->method('get')->will($this->returnValueMap($getMap));
104
+                    ->method('get')->will($this->returnValueMap($getMap));
105 105
 
106 106
         return $services;
107 107
     }
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $event = new \Zend\EventManager\Event();
181 181
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
182
-                       ->disableOriginalConstructor()
183
-                       ->setMethods(['setIdentifiers', 'setEventPrototype'])
184
-                       ->getMock()
182
+                        ->disableOriginalConstructor()
183
+                        ->setMethods(['setIdentifiers', 'setEventPrototype'])
184
+                        ->getMock()
185 185
         ;
186 186
         $events
187 187
             ->expects($this->once())
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     protected function setUp()
42 42
     {
43 43
         $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory')
44
-                             ->setMethods([ 'attachListeners', 'getConfig' ])
44
+                             ->setMethods(['attachListeners', 'getConfig'])
45 45
                              ->getMock();
46 46
     }
47 47
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $config['listeners'] = [];
55 55
         }
56 56
         if (!isset($config['identifiers'])) {
57
-            $config['identifiers'] = [ 'Test/Events/Manager' ];
57
+            $config['identifiers'] = ['Test/Events/Manager'];
58 58
         }
59 59
         if (!isset($config['event'])) {
60 60
             $config['event'] = '\Zend\EventManager\Event';
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
             $eventsService = 'Test/Events/Manager';
82 82
         }
83 83
 
84
-        $hasMap = [ [ $eventsService, true ] ];
85
-        $getMap = [ [ $eventsService, $events ] ];
84
+        $hasMap = [[$eventsService, true]];
85
+        $getMap = [[$eventsService, $events]];
86 86
 
87 87
         foreach ($args as $serviceName => $serviceValue) {
88 88
             if (false === $serviceValue) {
89
-                $hasMap[] = [ $serviceName, true ];
89
+                $hasMap[] = [$serviceName, true];
90 90
             } else {
91
-                $hasMap[] = [ $serviceName, true];
92
-                $getMap[] = [ $serviceName, $serviceValue ];
91
+                $hasMap[] = [$serviceName, true];
92
+                $getMap[] = [$serviceName, $serviceValue];
93 93
             }
94 94
         }
95 95
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $services->setService('Test/Events/Manager', $events);
115 115
 
116
-        $this->setTargetConfig([ 'service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]);
116
+        $this->setTargetConfig(['service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]);
117 117
 
118 118
         $this->target->expects($this->once())->method('attachListeners')->with($services, $events, []);
119 119
         $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events');
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     public function testInstatiatesEventManagerFromClassName()
123 123
     {
124
-        $this->setTargetConfig([ 'service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]);
124
+        $this->setTargetConfig(['service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]);
125 125
 
126 126
         $services = new ServiceManager();
127 127
         $events = $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant');
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $this->expectException(\UnexpectedValueException::class);
135 135
         $this->expectExceptionMessage('Cannot create');
136 136
 
137
-        $this->setTargetConfig(['service' => 'NonExistantClass' ]);
137
+        $this->setTargetConfig(['service' => 'NonExistantClass']);
138 138
 
139 139
         $this->target->createServiceWithName(new ServiceManager(), 'irrelevant', 'irrelevant');
140 140
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     public function testSetsIdentifiersOnEventManagerInstance()
151 151
     {
152
-        $ids = [ 'testID', 'TestId2' ];
152
+        $ids = ['testID', 'TestId2'];
153 153
         $events = new EventManager();
154 154
         $services = $this->getServiceManagerMock(['EventManager' => $events]);
155 155
         $this->setTargetConfig(['configure' => true, 'identifiers' => $ids, 'service' => 'EventManager']);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             ->with($event)
171 171
         ;
172 172
 
173
-        $services = $this->getServiceManagerMock(['EventManager' => $events], [ 'Event' => $event ]);
173
+        $services = $this->getServiceManagerMock(['EventManager' => $events], ['Event' => $event]);
174 174
         $this->setTargetConfig(['configure' => true, 'service' => 'EventManager', 'event' => 'Event']);
175 175
         $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events');
176 176
     }
Please login to merge, or discard this patch.
Factory/EventManager/EventManagerAbstractFactory/AttachListenersTest.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
     protected function setUp()
47 47
     {
48 48
         $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory')
49
-                             ->setMethods([ 'createEventManager', 'getConfig' ])
50
-                             ->getMock();
49
+                                ->setMethods([ 'createEventManager', 'getConfig' ])
50
+                                ->getMock();
51 51
 
52 52
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
53
-                       ->disableOriginalConstructor()
54
-                       ->setMethods(['attach'])
55
-                       ->getMock();
53
+                        ->disableOriginalConstructor()
54
+                        ->setMethods(['attach'])
55
+                        ->getMock();
56 56
 
57 57
         $this->target->expects($this->once())->method('createEventManager')->willReturn($events);
58 58
         $this->events = $events;
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
     protected function getServiceManagerMock($listeners, $expectLazyListeners = false)
68 68
     {
69 69
         $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')
70
-                         ->disableOriginalConstructor()
71
-                         ->getMock();
70
+                            ->disableOriginalConstructor()
71
+                            ->getMock();
72 72
 
73 73
 
74 74
         $hasMap = [ ];
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
         ;
102 102
 
103 103
         $services->expects($this->exactly(count($getMap)))
104
-                 ->method('get')
105
-                 ->will($this->returnValueMap($getMap))
104
+                    ->method('get')
105
+                    ->will($this->returnValueMap($getMap))
106 106
         ;
107 107
 
108 108
         return $services;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     public function testCallsAttachOnListenerAggregates()
167 167
     {
168 168
         $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface')
169
-                              ->getMockForAbstractClass();
169
+                                ->getMockForAbstractClass();
170 170
         $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]);
171 171
         
172 172
         $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]);
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     protected function setUp()
47 47
     {
48 48
         $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory')
49
-                             ->setMethods([ 'createEventManager', 'getConfig' ])
49
+                             ->setMethods(['createEventManager', 'getConfig'])
50 50
                              ->getMock();
51 51
 
52 52
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     protected function setTargetListenerConfig($config)
62 62
     {
63
-        $cfg = [ 'listeners' => $config ];
63
+        $cfg = ['listeners' => $config];
64 64
         $this->target->expects($this->once())->method('getConfig')->willReturn($cfg);
65 65
     }
66 66
 
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
                          ->getMock();
72 72
 
73 73
 
74
-        $hasMap = [ ];
75
-        $getMap = [ ];
74
+        $hasMap = [];
75
+        $getMap = [];
76 76
         $defaultListenerMock = new AttachListenerTestListenerMock();
77 77
 
78 78
         $lazyAggregateMock = $this->getLazyAggregateMock($expectLazyListeners);
79 79
         if ($expectLazyListeners) {
80 80
             $lazyAggregateMock->expects($this->once())->method('attach');
81
-            $getMap[] = [ 'Core/Listener/DeferredListenerAggregate', $lazyAggregateMock ];
81
+            $getMap[] = ['Core/Listener/DeferredListenerAggregate', $lazyAggregateMock];
82 82
         }
83 83
 
84 84
         foreach ($listeners as $serviceName => $listenerMock) {
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
             }
89 89
 
90 90
             if (false === $listenerMock) {
91
-                $hasMap[] = [ $serviceName, false];
91
+                $hasMap[] = [$serviceName, false];
92 92
             } else {
93
-                $hasMap[] = [ $serviceName, true ];
94
-                $getMap[] = [ $serviceName, $listenerMock ];
93
+                $hasMap[] = [$serviceName, true];
94
+                $getMap[] = [$serviceName, $listenerMock];
95 95
             }
96 96
         }
97 97
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
     public function testPullsListenersFromServiceManager()
137 137
     {
138
-        $this->setTargetListenerConfig(['TestListener' => ['test-event','doSomething',1]]);
138
+        $this->setTargetListenerConfig(['TestListener' => ['test-event', 'doSomething', 1]]);
139 139
         $services = $this->getServiceManagerMock(['TestListener']);
140 140
         $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant');
141 141
     }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     public function testCreatesListenersInstances()
144 144
     {
145 145
         $this->setTargetListenerConfig(
146
-            ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event','doSomething',1]]
146
+            ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event', 'doSomething', 1]]
147 147
         );
148 148
         $services = $this->getServiceManagerMock([
149 149
             '\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => false
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface')
169 169
                               ->getMockForAbstractClass();
170
-        $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]);
170
+        $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([$this->events, 1], [$this->events, -100]);
171 171
         
172 172
         $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]);
173 173
         $services = $this->getServiceManagerMock(['TestAggregate' => $aggregateMock, 'TestAggregate2' => $aggregateMock]);
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $listenerMock = new AttachListenerTestListenerMock();
181 181
         $this->setTargetListenerConfig([
182
-            'TestListener1' => ['test-event1','doSomething',1],
183
-            'TestListener2' => ['test-event2','doSomething',2]
182
+            'TestListener1' => ['test-event1', 'doSomething', 1],
183
+            'TestListener2' => ['test-event2', 'doSomething', 2]
184 184
         ]);
185 185
         $services = $this->getServiceManagerMock([
186 186
             'TestListener1' => $listenerMock,
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
             ->expects($this->exactly(2))
191 191
             ->method('attach')
192 192
             ->withConsecutive(
193
-                ['test-event1', [$listenerMock,'doSomething'], 1 ],
194
-                ['test-event2', [$listenerMock, 'doSomething'], 2 ]
193
+                ['test-event1', [$listenerMock, 'doSomething'], 1],
194
+                ['test-event2', [$listenerMock, 'doSomething'], 2]
195 195
             )
196 196
         ;
197 197
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $listenerMock = new AttachListenerTestListenerMock();
204 204
         $singleEvent = 'event';
205 205
         $expectSingleEvent = $singleEvent;
206
-        $multiEvent  = [ 'event1', 'event2' ];
206
+        $multiEvent  = ['event1', 'event2'];
207 207
         $method = 'doSomething';
208 208
         $additionalMethod = 'doSomethingElse';
209 209
         $priority = 1;
@@ -212,30 +212,30 @@  discard block
 block discarded – undo
212 212
         $notLazy = false;
213 213
 
214 214
         $listeners = [
215
-            'Test01' => [ $singleEvent, $method],
216
-            'Test02' => [ $singleEvent, $method ],
217
-            'Test03' => [ $multiEvent, $method ],
218
-            'Test04' => [ $singleEvent, $method ],
219
-            'Test05' => [ $multiEvent, $method ],
220
-            'Test06' => [ $singleEvent, $method, $priority ],
221
-            'Test07' => [ $multiEvent, $method, $priority ],
222
-            'Test08' => [ $singleEvent, $method, $priority, $lazy ],
223
-            'Test09' => [ $multiEvent, $method, $priority, $lazy ],
224
-            'Test10' => [ $singleEvent,$method, $priority ],
225
-            'Test11' => [ $multiEvent, $method, $priority ],
226
-            'Test12' => [ $singleEvent,$method, $lazy ],
227
-            'Test13' => [ $multiEvent,$method, $lazy ],
228
-            'Test14' => [ $singleEvent, $method, $additionalMethod ],
229
-            'Test15' => [ $multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority ],
215
+            'Test01' => [$singleEvent, $method],
216
+            'Test02' => [$singleEvent, $method],
217
+            'Test03' => [$multiEvent, $method],
218
+            'Test04' => [$singleEvent, $method],
219
+            'Test05' => [$multiEvent, $method],
220
+            'Test06' => [$singleEvent, $method, $priority],
221
+            'Test07' => [$multiEvent, $method, $priority],
222
+            'Test08' => [$singleEvent, $method, $priority, $lazy],
223
+            'Test09' => [$multiEvent, $method, $priority, $lazy],
224
+            'Test10' => [$singleEvent, $method, $priority],
225
+            'Test11' => [$multiEvent, $method, $priority],
226
+            'Test12' => [$singleEvent, $method, $lazy],
227
+            'Test13' => [$multiEvent, $method, $lazy],
228
+            'Test14' => [$singleEvent, $method, $additionalMethod],
229
+            'Test15' => [$multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority],
230 230
         ];
231 231
 
232 232
         $expectedLazyListeners = [
233
-            [ 'service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority ],
234
-            [ 'service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority ],
235
-            [ 'service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority ],
236
-            [ 'service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1 ],
237
-            [ 'service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1],
238
-            [ 'service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1],
233
+            ['service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority],
234
+            ['service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority],
235
+            ['service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority],
236
+            ['service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1],
237
+            ['service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1],
238
+            ['service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1],
239 239
         ];
240 240
 
241 241
         $servicesCfg = array_fill_keys([
@@ -252,26 +252,26 @@  discard block
 block discarded – undo
252 252
 
253 253
         $this->setTargetListenerConfig($listeners);
254 254
         $services = $this->getServiceManagerMock($servicesCfg, true);
255
-        $expectedCallback = [$listenerMock,'doSomething'];
255
+        $expectedCallback = [$listenerMock, 'doSomething'];
256 256
         $this->events->expects($this->exactly(16))
257 257
             ->method('attach')
258 258
             ->withConsecutive(
259
-                [ $expectSingleEvent, $expectedCallback, 1 ],
260
-                [ $expectSingleEvent, $expectedCallback, 1 ],
261
-                [ 'event1', $expectedCallback, 1],
262
-                [ 'event2', $expectedCallback, 1],
263
-                [ $expectSingleEvent, $expectedCallback, 1],
264
-                [ 'event1', $expectedCallback, 1],
265
-                [ 'event2', $expectedCallback, 1],
266
-                [ $expectSingleEvent, $expectedCallback, $priority],
267
-                [ 'event1', $expectedCallback, $priority],
268
-                [ 'event2', $expectedCallback, $priority],
269
-                [ $expectSingleEvent, $expectedCallback, $priority ],
270
-                [ 'event1', $expectedCallback, $priority ],
271
-                [ 'event2', $expectedCallback, $priority ],
272
-                [ $expectSingleEvent, [$listenerMock,$additionalMethod], 1],
273
-                [ 'event1', $expectedCallback, $additionalPriority ],
274
-                [ 'event2', $expectedCallback, $additionalPriority ]
259
+                [$expectSingleEvent, $expectedCallback, 1],
260
+                [$expectSingleEvent, $expectedCallback, 1],
261
+                ['event1', $expectedCallback, 1],
262
+                ['event2', $expectedCallback, 1],
263
+                [$expectSingleEvent, $expectedCallback, 1],
264
+                ['event1', $expectedCallback, 1],
265
+                ['event2', $expectedCallback, 1],
266
+                [$expectSingleEvent, $expectedCallback, $priority],
267
+                ['event1', $expectedCallback, $priority],
268
+                ['event2', $expectedCallback, $priority],
269
+                [$expectSingleEvent, $expectedCallback, $priority],
270
+                ['event1', $expectedCallback, $priority],
271
+                ['event2', $expectedCallback, $priority],
272
+                [$expectSingleEvent, [$listenerMock, $additionalMethod], 1],
273
+                ['event1', $expectedCallback, $additionalPriority],
274
+                ['event2', $expectedCallback, $additionalPriority]
275 275
         );
276 276
 
277 277
         $this->target->createServiceWithName($services, '', '');
@@ -280,32 +280,32 @@  discard block
 block discarded – undo
280 280
     public function testNormalizeListenerOptionsWithArrayHashSpecification()
281 281
     {
282 282
         $listenerMock = new AttachListenerTestListenerMock();
283
-        $singleEvent = [ 'singleEvent' ];
284
-        $priorityEvent = [ 'prioEvent' => 10 ];
285
-        $methodEvent = [ 'methodEvent' => 'doSomething' ];
286
-        $singleAndPriorityAndMethodEvent = [ 'single', 'priority' => 10, 'method' => 'doSomething'];
287
-        $verboseEvent = [ 'verbose' => [ 'method' => 'doSomething', 'priority' => 20]];
288
-        $verboseFullEvent = [ 'verbose' => [ 'method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]];
289
-        $multiEvent = [ 'multi1', 'multi2' ];
283
+        $singleEvent = ['singleEvent'];
284
+        $priorityEvent = ['prioEvent' => 10];
285
+        $methodEvent = ['methodEvent' => 'doSomething'];
286
+        $singleAndPriorityAndMethodEvent = ['single', 'priority' => 10, 'method' => 'doSomething'];
287
+        $verboseEvent = ['verbose' => ['method' => 'doSomething', 'priority' => 20]];
288
+        $verboseFullEvent = ['verbose' => ['method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]];
289
+        $multiEvent = ['multi1', 'multi2'];
290 290
 
291 291
         $listeners = [
292
-            'Test01' => [ 'events' => $singleEvent, 'method' => 'doSomething'],
293
-            'Test02' => [ 'events' => $priorityEvent, 'method' => 'doSomething'],
294
-            'Test03' => [ 'events' => $methodEvent, 'method' => 'doSomething'],
295
-            'Test04' => [ 'events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12],
296
-            'Test05' => [ 'events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12],
297
-            'Test06' => [ 'events' => $methodEvent,'method'=>'doSomething', 'priority' => 12],
298
-            'Test07' => [ 'events' => $singleEvent, 'method' => 'doSomething'],
299
-            'Test08' => [ 'events' => $priorityEvent, 'method' => 'doSomething'],
300
-            'Test09' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse'],
301
-            'Test10' => [ 'events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12],
302
-            'Test11' => [ 'events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12],
303
-            'Test12' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12],
304
-            'Test13' => [ 'events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'],
305
-            'Test14' => [ 'events' => $verboseEvent],
306
-            'Test15' => [ 'events' => $verboseFullEvent],
307
-            'Test16' => [ 'events' => $singleEvent, 'lazy' => true],
308
-            'Test17' => [ 'events' => $multiEvent, 'method' => 'multiMethod' ],
292
+            'Test01' => ['events' => $singleEvent, 'method' => 'doSomething'],
293
+            'Test02' => ['events' => $priorityEvent, 'method' => 'doSomething'],
294
+            'Test03' => ['events' => $methodEvent, 'method' => 'doSomething'],
295
+            'Test04' => ['events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12],
296
+            'Test05' => ['events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12],
297
+            'Test06' => ['events' => $methodEvent, 'method'=>'doSomething', 'priority' => 12],
298
+            'Test07' => ['events' => $singleEvent, 'method' => 'doSomething'],
299
+            'Test08' => ['events' => $priorityEvent, 'method' => 'doSomething'],
300
+            'Test09' => ['events' => $methodEvent, 'method' => 'doSomethingElse'],
301
+            'Test10' => ['events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12],
302
+            'Test11' => ['events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12],
303
+            'Test12' => ['events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12],
304
+            'Test13' => ['events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'],
305
+            'Test14' => ['events' => $verboseEvent],
306
+            'Test15' => ['events' => $verboseFullEvent],
307
+            'Test16' => ['events' => $singleEvent, 'lazy' => true],
308
+            'Test17' => ['events' => $multiEvent, 'method' => 'multiMethod'],
309 309
         ];
310 310
     
311 311
         $servicesCfg = array_fill_keys([
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             'Test15', 'Test17',
315 315
         ], $listenerMock);
316 316
         $expectedLazyListeners = [
317
-            [ 'service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1 ],
317
+            ['service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1],
318 318
         ];
319 319
 
320 320
         $lazyAggregateMock = $this->getLazyAggregateMock();
@@ -328,33 +328,33 @@  discard block
 block discarded – undo
328 328
         $this->setTargetListenerConfig($listeners);
329 329
         $services = $this->getServiceManagerMock($servicesCfg, true);
330 330
         
331
-        $callback1 = [$listenerMock,'doSomething'];
332
-        $callback2 = [$listenerMock,'doSomethingElse'];
331
+        $callback1 = [$listenerMock, 'doSomething'];
332
+        $callback2 = [$listenerMock, 'doSomethingElse'];
333 333
         $this->events
334 334
             ->expects($this->exactly(20))
335 335
             ->method('attach')
336 336
             ->withConsecutive(
337
-                [ $singleEvent[0], $callback1, 1 ],
338
-                [ 'prioEvent', $callback1, 10 ],
339
-                [ 'methodEvent', $callback1, 1],
340
-                [ $singleEvent[0], $callback1, 12],
341
-                [ 'prioEvent', $callback1, 10],
342
-                [ 'methodEvent', $callback1, 12],
343
-                [ $singleEvent[0], $callback1, 1],
344
-                [ 'prioEvent' , $callback1, 10],
345
-                [ 'methodEvent', $callback1, 1],
346
-                [ $singleEvent[0], $callback1, 12],
347
-                [ 'prioEvent', $callback2, 10],
348
-                [ 'methodEvent', $callback1, 12],
349
-                [ 'single', $callback1, 1 ],
350
-                [ 'method' , $callback1, 1],
351
-                [ 'priority', $callback1, 10],
337
+                [$singleEvent[0], $callback1, 1],
338
+                ['prioEvent', $callback1, 10],
339
+                ['methodEvent', $callback1, 1],
340
+                [$singleEvent[0], $callback1, 12],
341
+                ['prioEvent', $callback1, 10],
342
+                ['methodEvent', $callback1, 12],
343
+                [$singleEvent[0], $callback1, 1],
344
+                ['prioEvent', $callback1, 10],
345
+                ['methodEvent', $callback1, 1],
346
+                [$singleEvent[0], $callback1, 12],
347
+                ['prioEvent', $callback2, 10],
348
+                ['methodEvent', $callback1, 12],
349
+                ['single', $callback1, 1],
350
+                ['method', $callback1, 1],
351
+                ['priority', $callback1, 10],
352 352
                 //[ [ 'method' ], $callback1, 1],
353
-                [ 'verbose', $callback1, 20],
354
-                [ 'verbose', $callback1, 30],
355
-                [ 'verbose', $callback2, 25],
356
-                [ 'multi1', [$listenerMock,'multiMethod'], 1],
357
-                [ 'multi2', [$listenerMock,'multiMethod'], 1]
353
+                ['verbose', $callback1, 20],
354
+                ['verbose', $callback1, 30],
355
+                ['verbose', $callback2, 25],
356
+                ['multi1', [$listenerMock, 'multiMethod'], 1],
357
+                ['multi2', [$listenerMock, 'multiMethod'], 1]
358 358
             )
359 359
         ;
360 360
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/View/Helper/SnippetFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         '@testCreateService' => ['mock' => ['__invoke']],
45 45
     ];
46 46
 
47
-    private $inheritance = [ FactoryInterface::class ];
47
+    private $inheritance = [FactoryInterface::class];
48 48
 
49 49
 
50 50
     public function testCreateService()
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/View/Helper/SocialButtonsFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $options = new ModuleOptions();
47 47
         $config = ['testwert'];
48 48
 
49
-        $HauptServiceLocator =  $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
49
+        $HauptServiceLocator = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
50 50
         $HauptServiceLocator->expects($this->exactly(2))->method('get')->withConsecutive(['Auth/Options'], ['Config'])->will($this->onConsecutiveCalls($options, $config));
51 51
 
52 52
         $target = new SocialButtonsFactory();
Please login to merge, or discard this patch.
Core/test/CoreTest/Factory/Paginator/RepositoryAbstractFactoryTest.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $qb->expects($this->once())->method('getQuery')->willReturn($q);
101 101
 
102 102
         $repositories = $this->getMockBuilder('\Core\Repository\RepositoryService')
103
-                             ->disableOriginalConstructor()->getMock();
103
+                                ->disableOriginalConstructor()->getMock();
104 104
 
105 105
         $repositories->expects($this->once())->method('createQueryBuilder')->willReturn($qb);
106 106
 
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
         $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
121 121
 
122 122
         $sm->expects($this->exactly(2))->method('get')
123
-                                       ->withConsecutive([ 'repositories' ], [ 'FilterManager'])
124
-                                       ->will($this->onConsecutiveCalls($repositories, $filters));
123
+                                        ->withConsecutive([ 'repositories' ], [ 'FilterManager'])
124
+                                        ->will($this->onConsecutiveCalls($repositories, $filters));
125 125
 
126 126
         $target = $this->target;
127 127
         $paginator = $target($sm, $serviceName, $options);
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
     public function serviceNamesProvider()
45 45
     {
46 46
         return [
47
-            [ 'Repository/Core/FileEntity', true ],
48
-            [ 'Core/FileEntity', true ],
49
-            [ 'Repository/NoModuleWillBeEverCalledThat/SomeEntity', false ],
50
-            [ 'ThisIsAHighlyUnCommonModuleName/ObscureEntity', false ],
47
+            ['Repository/Core/FileEntity', true],
48
+            ['Core/FileEntity', true],
49
+            ['Repository/NoModuleWillBeEverCalledThat/SomeEntity', false],
50
+            ['ThisIsAHighlyUnCommonModuleName/ObscureEntity', false],
51 51
         ];
52 52
     }
53 53
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             ->disableOriginalConstructor()
66 66
             ->getMock()
67 67
         ;
68
-        $method = "assert" . ($expected ? 'True' : 'False');
68
+        $method = "assert".($expected ? 'True' : 'False');
69 69
 
70 70
         $this->{$method}($this->target->canCreate($sm, $serviceName));
71 71
     }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     public function servicesProvider()
74 74
     {
75 75
         return [
76
-            [ 'Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false ],
77
-            [ 'Core/TestEntity', '\Core\Entity\TestEntity', [ 'testOption' => 'testValue' ], true ]
76
+            ['Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false],
77
+            ['Core/TestEntity', '\Core\Entity\TestEntity', ['testOption' => 'testValue'], true]
78 78
         ];
79 79
     }
80 80
 
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
                         ->disableOriginalConstructor()
109 109
                         ->setMethods(['has', 'get'])->getMockForAbstractClass();
110 110
 
111
-        $filters->expects($this->once())->method('has')->with('PaginationQuery/' . $serviceName)->willReturn($hasFilter);
111
+        $filters->expects($this->once())->method('has')->with('PaginationQuery/'.$serviceName)->willReturn($hasFilter);
112 112
 
113 113
         if ($hasFilter) {
114 114
             $filter = $this->getMockBuilder('\Zend\Filter\FilterInterface')->getMockForAbstractClass();
115 115
             $filter->expects($this->once())->method('filter')->with($options, $qb)->willReturn($qb);
116 116
 
117
-            $filters->expects($this->once())->method('get')->with('PaginationQuery/' . $serviceName)->willReturn($filter);
117
+            $filters->expects($this->once())->method('get')->with('PaginationQuery/'.$serviceName)->willReturn($filter);
118 118
         }
119 119
 
120 120
         $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
121 121
 
122 122
         $sm->expects($this->exactly(2))->method('get')
123
-                                       ->withConsecutive([ 'repositories' ], [ 'FilterManager'])
123
+                                       ->withConsecutive(['repositories'], ['FilterManager'])
124 124
                                        ->will($this->onConsecutiveCalls($repositories, $filters));
125 125
 
126 126
         $target = $this->target;
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Collection/IdentityWrapperTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     
35 35
     protected function setUp()
36 36
     {
37
-        $getEntryMock = function ($id) {
37
+        $getEntryMock = function($id) {
38 38
             $entry = $this->getMockBuilder(\stdClass::class)
39 39
                 ->setMethods(['getId'])
40 40
                 ->getMock();
@@ -291,11 +291,11 @@  discard block
 block discarded – undo
291 291
     public function testExistsWithKey()
292 292
     {
293 293
         $searchKey = key($this->entries);
294
-        $this->assertTrue($this->identityWrapper->exists(function ($key) use ($searchKey) {
294
+        $this->assertTrue($this->identityWrapper->exists(function($key) use ($searchKey) {
295 295
             return $key === $searchKey;
296 296
         }));
297 297
         $searchKey = 'non-existent';
298
-        $this->assertFalse($this->identityWrapper->exists(function ($key) use ($searchKey) {
298
+        $this->assertFalse($this->identityWrapper->exists(function($key) use ($searchKey) {
299 299
             return $key === $searchKey;
300 300
         }));
301 301
     }
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
     public function testExistsWithValue()
307 307
     {
308 308
         $searchValue = current($this->entries);
309
-        $this->assertTrue($this->identityWrapper->exists(function ($key, $value) use ($searchValue) {
309
+        $this->assertTrue($this->identityWrapper->exists(function($key, $value) use ($searchValue) {
310 310
             return $value === $searchValue;
311 311
         }));
312 312
         $searchValue = 'non-existent';
313
-        $this->assertFalse($this->identityWrapper->exists(function ($key, $value) use ($searchValue) {
313
+        $this->assertFalse($this->identityWrapper->exists(function($key, $value) use ($searchValue) {
314 314
             return $value === $searchValue;
315 315
         }));
316 316
     }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     public function testFilter()
322 322
     {
323 323
         $searchValue = current($this->entries);
324
-        $filter = function ($value) use ($searchValue) {
324
+        $filter = function($value) use ($searchValue) {
325 325
             return $value === $searchValue;
326 326
         };
327 327
         $filtered = $this->identityWrapper->filter($filter);
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
     public function testForAllWithKey()
337 337
     {
338 338
         $keys = array_keys($this->entries);
339
-        $this->assertTrue($this->identityWrapper->forAll(function ($key) use ($keys) {
339
+        $this->assertTrue($this->identityWrapper->forAll(function($key) use ($keys) {
340 340
             return in_array($key, $keys);
341 341
         }));
342 342
         $keys = ['non-existent'];
343
-        $this->assertFalse($this->identityWrapper->forAll(function ($key) use ($keys) {
343
+        $this->assertFalse($this->identityWrapper->forAll(function($key) use ($keys) {
344 344
             return in_array($key, $keys);
345 345
         }));
346 346
     }
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
     public function testForAllWithValue()
352 352
     {
353 353
         $values = array_values($this->entries);
354
-        $this->assertTrue($this->identityWrapper->forAll(function ($key, $value) use ($values) {
354
+        $this->assertTrue($this->identityWrapper->forAll(function($key, $value) use ($values) {
355 355
             return in_array($value, $values, true);
356 356
         }));
357 357
         $values = ['non-existent'];
358
-        $this->assertFalse($this->identityWrapper->forAll(function ($key, $value) use ($values) {
358
+        $this->assertFalse($this->identityWrapper->forAll(function($key, $value) use ($values) {
359 359
             return in_array($value, $values, true);
360 360
         }));
361 361
     }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function testMapValidOperation()
367 367
     {
368
-        $map = function ($value) {
368
+        $map = function($value) {
369 369
             $value->random = rand();
370 370
             return $value;
371 371
         };
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      */
382 382
     public function testMapInvalidOperation()
383 383
     {
384
-        $map = function ($value) {
384
+        $map = function($value) {
385 385
             return sprintf('id: %s', $value->getId());
386 386
         };
387 387
         $this->identityWrapper->map($map);
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     public function testPartitionWithKey()
394 394
     {
395 395
         $searchKey = key($this->entries);
396
-        $partitions = $this->identityWrapper->partition(function ($key) use ($searchKey) {
396
+        $partitions = $this->identityWrapper->partition(function($key) use ($searchKey) {
397 397
             return $key === $searchKey;
398 398
         });
399 399
         $expectedFirstPartiton = array_slice($this->entries, 0, 1, true);
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     public function testPartitionWithValue()
413 413
     {
414 414
         $searchValue = reset($this->entries);
415
-        $partitions = $this->identityWrapper->partition(function ($key, $value) use ($searchValue) {
415
+        $partitions = $this->identityWrapper->partition(function($key, $value) use ($searchValue) {
416 416
             return $value === $searchValue;
417 417
         });
418 418
         $expectedFirstPartiton = array_slice($this->entries, 0, 1, true);
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
     public function testSetIdentityExtractor()
555 555
     {
556 556
         $suffix = '.suffix';
557
-        $identityExtractor = function ($entry) use ($suffix) {
558
-            return $entry->getId() . $suffix;
557
+        $identityExtractor = function($entry) use ($suffix) {
558
+            return $entry->getId().$suffix;
559 559
         };
560 560
         
561 561
         $this->assertSame($this->identityWrapper, $this->identityWrapper->setIdentityExtractor($identityExtractor));
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Options/ImageSetOptionsTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
 
33 33
     private $target = ImageSetOptions::class;
34 34
 
35
-    private $inheritance = [ AbstractOptions::class ];
35
+    private $inheritance = [AbstractOptions::class];
36 36
 
37 37
     private $properties = [
38 38
         ['entityClass', ['default' => Image::class, '@value' => Image::class]],
39 39
         ['formElementName', ['default' => ImageSetInterface::ORIGINAL, 'value' => 'formElementNameValue']],
40
-        ['images', ['default'=>[ImageSetInterface::THUMBNAIL => [100,100]], 'value' => ['a' => [1,1]]]],
40
+        ['images', ['default'=>[ImageSetInterface::THUMBNAIL => [100, 100]], 'value' => ['a' => [1, 1]]]],
41 41
         ['entity', ['ignore_setter' => true, 'value@' => Image::class]],
42 42
     ];
43 43
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Mail/MailService/BaseTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,12 +84,12 @@
 block discarded – undo
84 84
         ));
85 85
 
86 86
         $translator = $this->getMockBuilder('\Zend\I18n\Translator\Translator')
87
-                           ->disableOriginalConstructor()
88
-                           ->getMock();
87
+                            ->disableOriginalConstructor()
88
+                            ->getMock();
89 89
 
90 90
         $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')
91
-                         ->disableOriginalConstructor()
92
-                         ->getMock();
91
+                            ->disableOriginalConstructor()
92
+                            ->getMock();
93 93
         
94 94
 
95 95
         $services
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             'stringtemplate' => '\Core\Mail\StringTemplateMessage',
67 67
         );
68 68
         $factories = array(
69
-            'htmltemplate'   => [HTMLTemplateMessage::class,'factory']
69
+            'htmltemplate'   => [HTMLTemplateMessage::class, 'factory']
70 70
         );
71 71
 
72 72
         $this->assertAttributeEquals(false, 'shareByDefault', $target, 'shareByDefault is not set to FALSE');
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Mail/MailService/SendMailTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     protected function setUp()
41 41
     {
42 42
         $test = $this;
43
-        $sendCallback = function ($value) use ($test) {
43
+        $sendCallback = function($value) use ($test) {
44 44
             return $value === $test->expectedMail;
45 45
         };
46 46
         $transport = $this->getMockForAbstractClass('\Zend\Mail\Transport\TransportInterface');
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
     public function testOverrideRecipient()
110 110
     {
111 111
         $overrideEmail = 'overidden@email';
112
-        $ccEmail="cc@email";
113
-        $bccEmail="bcc@email";
114
-        $toEmail="to@email";
112
+        $ccEmail = "cc@email";
113
+        $bccEmail = "bcc@email";
114
+        $toEmail = "to@email";
115 115
         
116 116
         $recipients = new AddressList();
117 117
         $recipients->add($overrideEmail);
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
         $this->target->send($mail);
129 129
 
130 130
         $headers = $mail->getHeaders();
131
-        $expectedTo = 'To: ' . $overrideEmail;
131
+        $expectedTo = 'To: '.$overrideEmail;
132 132
         $this->assertFalse($headers->has('cc'));
133 133
         $this->assertFalse($headers->has('bcc'));
134 134
         $this->assertTrue($headers->has('X-Original-Recipients'));
135 135
 
136 136
         $this->assertEquals($expectedTo, $headers->get('to')->toString());
137
-        $this->assertEquals('X-Original-Recipients: To: ' . $toEmail . '; Cc: ' . $ccEmail . '; Bcc: ' . $bccEmail, $headers->get('X-Original-Recipients')->toString());
137
+        $this->assertEquals('X-Original-Recipients: To: '.$toEmail.'; Cc: '.$ccEmail.'; Bcc: '.$bccEmail, $headers->get('X-Original-Recipients')->toString());
138 138
     }
139 139
 
140 140
     public function testSetsXMailerHeader()
Please login to merge, or discard this patch.