Passed
Push — develop ( 86ca6f...0e6a78 )
by Mathias
22:00 queued 14:21
created
Core/test/CoreTest/Listener/LanguageRouteListener/OnRouteCallbackTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     private $target = [
38 38
         LanguageRouteListener::class,
39
-        'mock' => [ 'detectLanguage' => ['return' => 'xx'], 'setLocale' ],
39
+        'mock' => ['detectLanguage' => ['return' => 'xx'], 'setLocale'],
40 40
         'args' => 'getConstructorArgs'
41 41
     ];
42 42
     
Please login to merge, or discard this patch.
CoreTest/Listener/LanguageRouteListener/OnDispatchErrorCallbackTest.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
     private $moduleOptions;
47 47
 
48 48
     public function testHandleConsoleRequests()
49
-   {
50
-       $event = $this
51
-           ->getMockBuilder(MvcEvent::class)
52
-           ->disableOriginalConstructor()
53
-           ->setMethods(['getRequest', 'getError'])
54
-           ->getMock()
55
-       ;
49
+    {
50
+        $event = $this
51
+            ->getMockBuilder(MvcEvent::class)
52
+            ->disableOriginalConstructor()
53
+            ->setMethods(['getRequest', 'getError'])
54
+            ->getMock()
55
+        ;
56 56
 
57
-       $request = new \Zend\Console\Request();
57
+        $request = new \Zend\Console\Request();
58 58
 
59
-       $event->expects($this->once())->method('getRequest')->willReturn($request);
60
-       $event->expects($this->never())->method('getError');
59
+        $event->expects($this->once())->method('getRequest')->willReturn($request);
60
+        $event->expects($this->never())->method('getError');
61 61
 
62
-       $this->assertNull($this->target->onDispatchError($event));
63
-   }
62
+        $this->assertNull($this->target->onDispatchError($event));
63
+    }
64 64
 
65 65
     public function testHandleNonRouteMatchErrors()
66 66
     {
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
         $event = $this->getEventMock('/base/uri', '/see/no/lang');
135 135
 
136 136
         $event->expects($this->once())
137
-              ->method('stopPropagation')
138
-              ->with(true)
137
+                ->method('stopPropagation')
138
+                ->with(true)
139 139
         ;
140 140
         $response = new Response();
141 141
         $event->setResponse($response);
@@ -148,18 +148,18 @@  discard block
 block discarded – undo
148 148
                     \PHPUnit_Framework_Assert::assertEquals('/base/uri/xx/see/no/lang', (string) $v->getUri());
149 149
                     return true;
150 150
                 }
151
-              ))
151
+                ))
152 152
             ->willReturn($routeMatch)
153 153
         ;
154 154
 
155 155
         $this->target
156
-	        ->expects($this->once())
157
-	        ->method('redirect')
158
-	        ->with($response, '/base/uri/xx/see/no/lang')
156
+            ->expects($this->once())
157
+            ->method('redirect')
158
+            ->with($response, '/base/uri/xx/see/no/lang')
159 159
         ;
160 160
         $this->target
161
-	        ->expects($this->never())
162
-	        ->method('setLocale')
161
+            ->expects($this->never())
162
+            ->method('setLocale')
163 163
         ;
164 164
 
165 165
         $this->target->onDispatchError($event);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     private $target = [
38 38
         LanguageRouteListener::class,
39
-        'mock' => [ 'detectLanguage' => ['return' => 'xx'], 'setLocale', 'isSupportedLanguage', 'redirect'],
39
+        'mock' => ['detectLanguage' => ['return' => 'xx'], 'setLocale', 'isSupportedLanguage', 'redirect'],
40 40
         'args' => 'getConstructorArgs'
41 41
     ];
42 42
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
         $target->expects($this->once())
223 223
             ->method('redirect')
224
-            ->with($response,'/base/uri/default/see/no/lang')
224
+            ->with($response, '/base/uri/default/see/no/lang')
225 225
         ;
226 226
 
227 227
         $target->onDispatchError($event);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     public function getConstructorArgs()
231 231
     {
232 232
         $this->moduleOptions = new ModuleOptions();
233
-        return [new LocaleService([]),$this->moduleOptions];
233
+        return [new LocaleService([]), $this->moduleOptions];
234 234
     }
235 235
 
236 236
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/LanguageRouteListener/BaseTest.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function testDetach()
73 73
     {
74
-    	$callableListener = [new CallableListenerMock(),'doSomething'];
74
+        $callableListener = [new CallableListenerMock(),'doSomething'];
75 75
     	
76 76
         $events = $this
77 77
             ->getMockBuilder(EventManager::class)
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
             ->getMock();
81 81
 
82 82
         $events
83
-	        ->expects($this->any())
84
-	        ->method('attach')
85
-	        ->will(
86
-	        	$this->onConsecutiveCalls($callableListener, $callableListener)
87
-	        )
83
+            ->expects($this->any())
84
+            ->method('attach')
85
+            ->will(
86
+                $this->onConsecutiveCalls($callableListener, $callableListener)
87
+            )
88 88
         ;
89 89
 
90 90
         $events
@@ -103,5 +103,5 @@  discard block
 block discarded – undo
103 103
 
104 104
 class CallableListenerMock
105 105
 {
106
-	public function doSomething(){}
106
+    public function doSomething(){}
107 107
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 
36 36
     private $target;
37 37
 
38
-    private $inheritance = [ ListenerAggregateInterface::class ];
38
+    private $inheritance = [ListenerAggregateInterface::class];
39 39
 
40 40
     public function setUp()
41 41
     {
42
-        $this->target = new LanguageRouteListener(new LocaleService(['xx' => 'xx_XX']),new ModuleOptions());
42
+        $this->target = new LanguageRouteListener(new LocaleService(['xx' => 'xx_XX']), new ModuleOptions());
43 43
     }
44 44
     
45 45
     public function testAttachsToExpectedEvents()
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function testDetach()
73 73
     {
74
-    	$callableListener = [new CallableListenerMock(),'doSomething'];
74
+    	$callableListener = [new CallableListenerMock(), 'doSomething'];
75 75
     	
76 76
         $events = $this
77 77
             ->getMockBuilder(EventManager::class)
@@ -103,5 +103,5 @@  discard block
 block discarded – undo
103 103
 
104 104
 class CallableListenerMock
105 105
 {
106
-	public function doSomething(){}
106
+	public function doSomething() {}
107 107
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/Events/AjaxEventTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     private $target = AjaxEvent::class;
32 32
 
33
-    private $inheritance = [ Event::class ];
33
+    private $inheritance = [Event::class];
34 34
 
35 35
     public function propertiesProvider()
36 36
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/Events/CreatePaginatorEventTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class CreatePaginatorEventTest extends \PHPUnit_Framework_TestCase
26 26
 {
27
-    use TestSetterGetterTrait,SetupTargetTrait;
27
+    use TestSetterGetterTrait, SetupTargetTrait;
28 28
 
29 29
     protected $target = [
30 30
         'class' => CreatePaginatorEvent::class
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
             ->getMock()
42 42
         ;
43 43
         return [
44
-            ['paginatorParams',[
44
+            ['paginatorParams', [
45 45
                 'value'     =>['name'=>'value'],
46 46
                 'default'   => array(),
47 47
             ]],
48
-            ['paginatorName',[
48
+            ['paginatorName', [
49 49
                 'value' => 'Some/Paginator',
50 50
                 'default'   => null,
51 51
             ]],
52
-            ['paginators',$paginators],
53
-            ['paginator',$paginator]
52
+            ['paginators', $paginators],
53
+            ['paginator', $paginator]
54 54
         ];
55 55
     }
56 56
 
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $target = $this->target;
73 73
         $target->setParams($params);
74 74
 
75
-        $this->assertEquals($params['paginatorName'],$target->getPaginatorName());
76
-        $this->assertEquals($params['paginatorParams'],$target->getPaginatorParams());
77
-        $this->assertEquals($params['paginators'],$target->getPaginators());
75
+        $this->assertEquals($params['paginatorName'], $target->getPaginatorName());
76
+        $this->assertEquals($params['paginatorParams'], $target->getPaginatorParams());
77
+        $this->assertEquals($params['paginators'], $target->getPaginators());
78 78
         $this->assertEquals(
79 79
             ['foo' => 'bar'],
80 80
             $target->getParams(),
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/Events/FileEventTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     private $target = FileEvent::class;
31 31
 
32
-    private $inheritance = [ Event::class ];
32
+    private $inheritance = [Event::class];
33 33
 
34 34
     public function propertiesProvider()
35 35
     {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             ]],
44 44
             ['file', $file],
45 45
             ['file', [
46
-                'pre' => function() use ($file) { $this->target->setParam('file', $file);},
46
+                'pre' => function() use ($file) { $this->target->setParam('file', $file); },
47 47
                 'ignore_setter' => true,
48 48
                 'value' => $file
49 49
             ]]
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/AjaxRouteListenerTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,8 +110,8 @@
 block discarded – undo
110 110
         $results->push($result1);
111 111
         $this->ajaxEventManagerMock->expects($this->once())->method('getEvent')->with('test', $this->target)->willReturn(new AjaxEvent());
112 112
         $this->ajaxEventManagerMock->expects($this->once())->method('triggerEventUntil')
113
-                                   ->with($this->isInstanceOf('\Closure'), $this->isInstanceOf(AjaxEvent::class))
114
-                                   ->willReturn($results);
113
+                                    ->with($this->isInstanceOf('\Closure'), $this->isInstanceOf(AjaxEvent::class))
114
+                                    ->willReturn($results);
115 115
 
116 116
         $response = $this->target->onRoute($event);
117 117
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
         '@testConstruction' => false,
41 41
         '@testInheritance' => '@testUsesTraits',
42 42
         '@testDefaultAttributes' => '@testUsesTraits',
43
-        '@testUsesTraits' => [ 'as_reflection' => true ],
43
+        '@testUsesTraits' => ['as_reflection' => true],
44 44
     ];
45 45
 
46
-    private $traits = [ ListenerAggregateTrait::class ];
46
+    private $traits = [ListenerAggregateTrait::class];
47 47
 
48 48
     private $attributes = [
49
-        'events' => [ [ MvcEvent::EVENT_ROUTE, 'onRoute', 100 ] ],
49
+        'events' => [[MvcEvent::EVENT_ROUTE, 'onRoute', 100]],
50 50
     ];
51 51
 
52 52
     private function getTargetArgs()
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $this->ajaxEventManagerMock = $this->getMockBuilder(EventManager::class)->disableOriginalConstructor()
55 55
             ->setMethods(['getEvent', 'triggerEventUntil'])->getMock();
56 56
 
57
-        return [ $this->ajaxEventManagerMock ];
57
+        return [$this->ajaxEventManagerMock];
58 58
     }
59 59
 
60 60
     public function testConstruction()
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Acl/FileAccessAssertionTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
         $failMessage = 'Assert should return false when role is not a user or resource is not file';
58 58
 
59 59
         $this->assertFalse(
60
-            $target->assert($acl,$roleInterface,$resourceInterface),
60
+            $target->assert($acl, $roleInterface, $resourceInterface),
61 61
             $failMessage
62 62
         );
63 63
 
64 64
         $this->assertFalse(
65
-            $target->assert($acl,$userRole,$resourceInterface),
65
+            $target->assert($acl, $userRole, $resourceInterface),
66 66
             $failMessage
67 67
         );
68 68
 
69 69
         $this->assertFalse(
70
-            $this->target->assert($acl,$roleInterface,$file),
70
+            $this->target->assert($acl, $roleInterface, $file),
71 71
             $failMessage
72 72
         );
73 73
     }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
         $permissions->expects($this->once())
91 91
             ->method('isGranted')
92
-            ->with($role,PermissionsInterface::PERMISSION_VIEW)
92
+            ->with($role, PermissionsInterface::PERMISSION_VIEW)
93 93
             ->willReturn(true)
94 94
         ;
95 95
         $this->assertTrue(
96
-            $target->assert($acl,$role,$file,PermissionsInterface::PERMISSION_VIEW)
96
+            $target->assert($acl, $role, $file, PermissionsInterface::PERMISSION_VIEW)
97 97
         );
98 98
     }
99 99
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Collection/IdentityWrapperTest.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         $entry = 'value';
78 78
         $count = count($this->wrappedCollection);
79
-		$this->identityWrapper->add($entry);
79
+        $this->identityWrapper->add($entry);
80 80
         $this->assertSame($count + 1, count($this->identityWrapper));
81 81
         $this->assertSame($count + 1, count($this->wrappedCollection));
82 82
         $this->assertTrue($this->identityWrapper->contains($entry));
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     public function testGetValues()
182 182
     {
183 183
         $expected = array_values($this->entries);
184
-		$this->assertSame($expected, $this->identityWrapper->getValues());
184
+        $this->assertSame($expected, $this->identityWrapper->getValues());
185 185
         $this->assertSame($expected, $this->wrappedCollection->getValues());
186 186
     }
187 187
 
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
     public function testFirst()
235 235
     {
236 236
         $expected = reset($this->entries);
237
-		$this->assertSame($expected, $this->identityWrapper->first());
238
-		$this->assertSame($expected, $this->wrappedCollection->first());
237
+        $this->assertSame($expected, $this->identityWrapper->first());
238
+        $this->assertSame($expected, $this->wrappedCollection->first());
239 239
     }
240 240
 
241 241
     /**
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
     public function testLast()
245 245
     {
246 246
         $expected = end($this->entries);
247
-		$this->assertSame($expected, $this->identityWrapper->last());
248
-		$this->assertSame($expected, $this->wrappedCollection->last());
247
+        $this->assertSame($expected, $this->identityWrapper->last());
248
+        $this->assertSame($expected, $this->wrappedCollection->last());
249 249
     }
250 250
 
251 251
     /**
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
             return $value === $searchValue;
325 325
         };
326 326
         $filtered = $this->identityWrapper->filter($filter);
327
-		$this->assertInstanceOf(IdentityWrapper::class, $filtered);
328
-		$this->assertNotSame($this->identityWrapper, $filtered);
329
-		$this->assertSame(array_filter($this->entries, $filter), $filtered->toArray());
327
+        $this->assertInstanceOf(IdentityWrapper::class, $filtered);
328
+        $this->assertNotSame($this->identityWrapper, $filtered);
329
+        $this->assertSame(array_filter($this->entries, $filter), $filtered->toArray());
330 330
     }
331 331
 
332 332
     /**
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     
33 33
     public function setUp()
34 34
     {
35
-        $getEntryMock = function ($id)
35
+        $getEntryMock = function($id)
36 36
         {
37 37
             $entry = $this->getMockBuilder(\stdClass::class)
38 38
                 ->setMethods(['getId'])
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
     public function testExistsWithKey()
291 291
     {
292 292
         $searchKey = key($this->entries);
293
-        $this->assertTrue($this->identityWrapper->exists(function ($key) use ($searchKey) {
293
+        $this->assertTrue($this->identityWrapper->exists(function($key) use ($searchKey) {
294 294
             return $key === $searchKey;
295 295
         }));
296 296
         $searchKey = 'non-existent';
297
-        $this->assertFalse($this->identityWrapper->exists(function ($key) use ($searchKey) {
297
+        $this->assertFalse($this->identityWrapper->exists(function($key) use ($searchKey) {
298 298
             return $key === $searchKey;
299 299
         }));
300 300
     }
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
     public function testExistsWithValue()
306 306
     {
307 307
         $searchValue = current($this->entries);
308
-        $this->assertTrue($this->identityWrapper->exists(function ($key, $value) use ($searchValue) {
308
+        $this->assertTrue($this->identityWrapper->exists(function($key, $value) use ($searchValue) {
309 309
             return $value === $searchValue;
310 310
         }));
311 311
         $searchValue = 'non-existent';
312
-        $this->assertFalse($this->identityWrapper->exists(function ($key, $value) use ($searchValue) {
312
+        $this->assertFalse($this->identityWrapper->exists(function($key, $value) use ($searchValue) {
313 313
             return $value === $searchValue;
314 314
         }));
315 315
     }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     public function testFilter()
321 321
     {
322 322
         $searchValue = current($this->entries);
323
-        $filter = function ($value) use ($searchValue) {
323
+        $filter = function($value) use ($searchValue) {
324 324
             return $value === $searchValue;
325 325
         };
326 326
         $filtered = $this->identityWrapper->filter($filter);
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
     public function testForAllWithKey()
336 336
     {
337 337
         $keys = array_keys($this->entries);
338
-        $this->assertTrue($this->identityWrapper->forAll(function ($key) use ($keys) {
338
+        $this->assertTrue($this->identityWrapper->forAll(function($key) use ($keys) {
339 339
             return in_array($key, $keys);
340 340
         }));
341 341
         $keys = ['non-existent'];
342
-        $this->assertFalse($this->identityWrapper->forAll(function ($key) use ($keys) {
342
+        $this->assertFalse($this->identityWrapper->forAll(function($key) use ($keys) {
343 343
             return in_array($key, $keys);
344 344
         }));
345 345
     }
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
     public function testForAllWithValue()
351 351
     {
352 352
         $values = array_values($this->entries);
353
-        $this->assertTrue($this->identityWrapper->forAll(function ($key, $value) use ($values) {
353
+        $this->assertTrue($this->identityWrapper->forAll(function($key, $value) use ($values) {
354 354
             return in_array($value, $values, true);
355 355
         }));
356 356
         $values = ['non-existent'];
357
-        $this->assertFalse($this->identityWrapper->forAll(function ($key, $value) use ($values) {
357
+        $this->assertFalse($this->identityWrapper->forAll(function($key, $value) use ($values) {
358 358
             return in_array($value, $values, true);
359 359
         }));
360 360
     }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      */
365 365
     public function testMapValidOperation()
366 366
     {
367
-        $map = function ($value) {
367
+        $map = function($value) {
368 368
             $value->random = rand();
369 369
             return $value;
370 370
         };
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     public function testMapInvalidOperation()
382 382
     {
383
-        $map = function ($value) {
383
+        $map = function($value) {
384 384
             return sprintf('id: %s', $value->getId());
385 385
         };
386 386
         $this->identityWrapper->map($map);
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     public function testPartitionWithKey()
393 393
     {
394 394
         $searchKey = key($this->entries);
395
-        $partitions = $this->identityWrapper->partition(function ($key) use ($searchKey) {
395
+        $partitions = $this->identityWrapper->partition(function($key) use ($searchKey) {
396 396
             return $key === $searchKey;
397 397
         });
398 398
         $expectedFirstPartiton = array_slice($this->entries, 0, 1, true);
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     public function testPartitionWithValue()
412 412
     {
413 413
         $searchValue = reset($this->entries);
414
-        $partitions = $this->identityWrapper->partition(function ($key, $value) use ($searchValue) {
414
+        $partitions = $this->identityWrapper->partition(function($key, $value) use ($searchValue) {
415 415
             return $value === $searchValue;
416 416
         });
417 417
         $expectedFirstPartiton = array_slice($this->entries, 0, 1, true);
@@ -553,8 +553,8 @@  discard block
 block discarded – undo
553 553
     public function testSetIdentityExtractor()
554 554
     {
555 555
         $suffix = '.suffix';
556
-        $identityExtractor = function ($entry) use ($suffix) {
557
-            return $entry->getId() . $suffix;
556
+        $identityExtractor = function($entry) use ($suffix) {
557
+            return $entry->getId().$suffix;
558 558
         };
559 559
         
560 560
         $this->assertSame($this->identityWrapper, $this->identityWrapper->setIdentityExtractor($identityExtractor));
Please login to merge, or discard this patch.