Passed
Push — master ( 6292f6...e5b7ab )
by Mathias
10:49 queued 04:59
created
module/Core/test/CoreTest/Listener/Events/AjaxEventTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     private $target = AjaxEvent::class;
34 34
 
35
-    private $inheritance = [ Event::class ];
35
+    private $inheritance = [Event::class];
36 36
 
37 37
     public function propertiesProvider()
38 38
     {
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
             ['contentType', [
43 43
                 'value' => 'test/type',
44 44
                 'default' => AjaxEvent::TYPE_JSON,
45
-                'post' => function () {
45
+                'post' => function() {
46 46
                     $this->assertEquals('test/type', $this->target->getParam('contentType'));
47 47
                 },
48 48
             ]],
49 49
             ['contentType', [
50
-                'pre' => function () {
50
+                'pre' => function() {
51 51
                     $this->target->setParam('contentType', 'type/test');
52 52
                 },
53 53
                 'value' => 'type/test',
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
             ['request', [
58 58
                 'value' => $request,
59 59
                 'default' => null,
60
-                'post' => function () use ($request) {
60
+                'post' => function() use ($request) {
61 61
                     $this->assertSame($request, $this->target->getParam('request'));
62 62
                 },
63 63
             ]],
64 64
             ['request', [
65
-                'pre' => function () use ($request) {
65
+                'pre' => function() use ($request) {
66 66
                     $this->target->setParam('request', $request);
67 67
                 },
68 68
                 'value' => $request,
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
             ['response', [
73 73
                 'value' => $response,
74 74
                 'default' => null,
75
-                'post' => function () use ($response) {
75
+                'post' => function() use ($response) {
76 76
                     $this->assertSame($response, $this->target->getParam('response'));
77 77
                 },
78 78
             ]],
79 79
             ['response', [
80
-                'pre' => function () use ($response) {
80
+                'pre' => function() use ($response) {
81 81
                     $this->target->setParam('response', $response);
82 82
                 },
83 83
                 'value' => $response,
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
             ['result', [
89 89
                 'value' => 'testResult',
90 90
                 'default' => null,
91
-                'post' => function () {
91
+                'post' => function() {
92 92
                     $this->assertEquals('testResult', $this->target->getParam('result'));
93 93
                 },
94 94
             ]],
95 95
             ['result', [
96
-                'pre' => function () {
96
+                'pre' => function() {
97 97
                     $this->target->setParam('result', 'testResult');
98 98
                 },
99 99
                 'value' => 'testResult',
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/Events/CreatePaginatorEventTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 class CreatePaginatorEventTest extends TestCase
28 28
 {
29
-    use TestSetterGetterTrait,SetupTargetTrait;
29
+    use TestSetterGetterTrait, SetupTargetTrait;
30 30
 
31 31
     protected $target = [
32 32
         'class' => CreatePaginatorEvent::class
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
             ->getMock()
44 44
         ;
45 45
         return [
46
-            ['paginatorParams',[
46
+            ['paginatorParams', [
47 47
                 'value'     =>['name'=>'value'],
48 48
                 'default'   => array(),
49 49
             ]],
50
-            ['paginatorName',[
50
+            ['paginatorName', [
51 51
                 'value' => 'Some/Paginator',
52 52
                 'default'   => null,
53 53
             ]],
54
-            ['paginators',$paginators],
55
-            ['paginator',$paginator]
54
+            ['paginators', $paginators],
55
+            ['paginator', $paginator]
56 56
         ];
57 57
     }
58 58
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Listener/Events/FileEventTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     private $target = FileEvent::class;
33 33
 
34
-    private $inheritance = [ Event::class ];
34
+    private $inheritance = [Event::class];
35 35
 
36 36
     public function propertiesProvider()
37 37
     {
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
             ['params', [
42 42
                 'value' => ['file' => $file, 'one' => 'two'],
43 43
                 'expect' => ['one' => 'two'],
44
-                'post' => function () use ($file) {
44
+                'post' => function() use ($file) {
45 45
                     $this->assertSame($file, $this->target->getFile());
46 46
                 },
47 47
             ]],
48 48
             ['file', $file],
49 49
             ['file', [
50
-                'pre' => function () use ($file) {
50
+                'pre' => function() use ($file) {
51 51
                     $this->target->setParam('file', $file);
52 52
                 },
53 53
                 'ignore_setter' => true,
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/MongoQueueTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     private $target = [
38 38
         MongoQueue::class,
39 39
         'setupArgs',
40
-        '@testInheritance' => [ 'as_reflection' => true ],
40
+        '@testInheritance' => ['as_reflection' => true],
41 41
         '@testConstruction' => false,
42 42
         '@testPushLazyWithStringName' => '#mockPush',
43 43
         '@testPushLazyWithArraySpec' => '#mockPush',
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         ]
47 47
     ];
48 48
 
49
-    private $inheritance = [ AbstractQueue::class ];
49
+    private $inheritance = [AbstractQueue::class];
50 50
 
51 51
     /**
52 52
      *
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             ->setMethods(['getInsertedId'])->getMock();
128 128
         $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID');
129 129
         $this->mongoCollectionMock->expects($this->once())->method('insertOne')
130
-            ->with($this->callback(function ($value) {
130
+            ->with($this->callback(function($value) {
131 131
                 return isset($value['queue']) && $value['queue'] == $this->queueName
132 132
                     && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING
133 133
                     && !isset($value['tried'])
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                            ->setMethods(['getInsertedId'])->getMock();
157 157
         $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID');
158 158
         $this->mongoCollectionMock->expects($this->once())->method('insertOne')
159
-                                  ->with($this->callback(function ($value) use ($options) {
159
+                                  ->with($this->callback(function($value) use ($options) {
160 160
                                       return isset($value['queue']) && $value['queue'] == $this->queueName
161 161
                                              && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING
162 162
                                              && !isset($value['tried'])
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                                              && isset($value['created']) && isset($value['scheduled'])
165 165
                                              && $value['scheduled'] instanceof \MongoDB\BSON\UTCDateTime
166 166
                                              && $value['created'] instanceof \MongoDB\BSON\UTCDateTime
167
-                                             && (int) ((string) $value['scheduled']) - (int) ((string)$value['created']) == $options['delay'] * 1000
167
+                                             && (int) ((string) $value['scheduled']) - (int) ((string) $value['created']) == $options['delay'] * 1000
168 168
                                              && isset($value['priority']) && $value['priority'] == $options['priority']
169 169
                                           ;
170 170
                                   }))
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                                   ->with(
188 188
                                       $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
189 189
                                       $this->callback(
190
-                                          function ($value) {
190
+                                          function($value) {
191 191
                                               if (!array_key_exists('$set', $value)) {
192 192
                                                   return false;
193 193
                                               }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $this->jobManagerMock->expects($this->once())->method('get')->with(get_class($job))->willReturn(new $this->testJobClass());
217 217
         $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate')
218 218
                                   ->with(
219
-                                      $this->callback(function ($value) {
219
+                                      $this->callback(function($value) {
220 220
                                           return
221 221
                                                     isset($value['queue']) && $value['queue'] == $this->queueName
222 222
                                                     && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                                               ;
225 225
                                       }),
226 226
                                       $this->callback(
227
-                                          function ($value) {
227
+                                          function($value) {
228 228
                                               if (!array_key_exists('$set', $value)) {
229 229
                                                   return false;
230 230
                                               }
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
                                               ;
235 235
                                           }
236 236
                                       ),
237
-                                      $this->callback(function ($value) {
237
+                                      $this->callback(function($value) {
238 238
                                           return
239 239
                                             isset($value['sort']) && $value['sort'] == ['priority' => 1, 'scheduled' => 1]
240
-                                              && isset($value['returnDocument'])&&$value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER
240
+                                              && isset($value['returnDocument']) && $value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER
241 241
                                               ;
242 242
                                       })
243 243
                                   )
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
         /* @var AbstractJob $job2 */
265 265
         $job1 = new $this->testJobClass('TestJob1');
266 266
         $job2 = new $this->testJobClass('TestJob2');
267
-        $filter = [ 'queue' => $this->queueName ];
268
-        $opt    = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ] ];
267
+        $filter = ['queue' => $this->queueName];
268
+        $opt    = ['sort' => ['scheduled' => 1, 'priority' => 1]];
269 269
         $envelopes = [
270 270
             [
271 271
                 '_id' => $job1->getId(),
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             ],
282 282
         ];
283 283
         $this->jobManagerMock->expects($this->exactly(2))->method('get')
284
-            ->with($this->testJobClass)->will($this->returnCallback(function () {
284
+            ->with($this->testJobClass)->will($this->returnCallback(function() {
285 285
                 return new $this->testJobClass();
286 286
             }));
287 287
 
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
         $jobs = $this->target->listing();
308 308
 
309 309
         $this->assertEquals(1, $cursor->called, "Cursor::toArray should have been called exactly one time, but was called '{$cursor->called}' times'");
310
-        $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "' . gettype($jobs) . '" instead."');
311
-        $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were ' . count($jobs));
310
+        $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "'.gettype($jobs).'" instead."');
311
+        $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were '.count($jobs));
312 312
 
313 313
         $this->assertArrayHasKey('job', $jobs[0]);
314 314
         $this->assertEquals($job1, $jobs[0]['job'], 'Job1 is not the same');
@@ -323,8 +323,8 @@  discard block
 block discarded – undo
323 323
             'limit' => 10,
324 324
         ];
325 325
 
326
-        $filter = [ 'queue' => $this->queueName, 'status' => $options['status'] ];
327
-        $opt    = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ], 'limit' => $options['limit'] ];
326
+        $filter = ['queue' => $this->queueName, 'status' => $options['status']];
327
+        $opt    = ['sort' => ['scheduled' => 1, 'priority' => 1], 'limit' => $options['limit']];
328 328
 
329 329
         $this->jobManagerMock->expects($this->never())->method('get');
330 330
         $cursor = new class() {
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                                   ->with(
352 352
                                       $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
353 353
                                       $this->callback(
354
-                                          function ($value) use ($options) {
354
+                                          function($value) use ($options) {
355 355
                                               if (!array_key_exists('$set', $value)) {
356 356
                                                   return false;
357 357
                                               }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/MongoQueueFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      */
39 39
     private $target = MongoQueueFactory::class;
40 40
 
41
-    private $inheritance = [ FactoryInterface::class ];
41
+    private $inheritance = [FactoryInterface::class];
42 42
 
43 43
     public function testCreateServiceWithoutConfig()
44 44
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Strategy/LogStrategyTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         '@testConstructor*' => false,
50 50
     ];
51 51
 
52
-    private $inheritance = [ AbstractStrategy::class ];
52
+    private $inheritance = [AbstractStrategy::class];
53 53
 
54 54
     private $attributes = [
55 55
         'tmpl' => [
Please login to merge, or discard this patch.
Core/test/CoreTest/Entity/Hydrator/Factory/ImageSetHydratorFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         ],
48 48
     ];
49 49
 
50
-    private $inheritance = [ FactoryInterface::class ];
50
+    private $inheritance = [FactoryInterface::class];
51 51
 
52 52
     private function getInvocationArgs()
53 53
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Entity/StatusAwareEntityTraitTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,34 +35,34 @@
 block discarded – undo
35 35
     {
36 36
         return [
37 37
 
38
-            [ 'status', [
38
+            ['status', [
39 39
                 'value' => new Status(Status::STATE_ONE),
40 40
                 'target' => new StatusAwareEntity(),
41 41
             ]],
42 42
 
43
-            [ 'status', [
43
+            ['status', [
44 44
                 'target' => new ProvideEntityStatusAwareEntity(),
45 45
                 'default' => true,
46
-                'default_assert' => function ($g, $return) {
46
+                'default_assert' => function($g, $return) {
47 47
                     $this->assertEquals(new Status(Status::STATE_ONE), $return);
48 48
                 },
49 49
                 'value' => Status::STATE_TWO,
50
-                'getter_assert' => function ($g, $return, $v) {
50
+                'getter_assert' => function($g, $return, $v) {
51 51
                     $this->assertEquals(new Status(Status::STATE_TWO), $return);
52 52
                 },
53 53
             ]],
54 54
 
55
-            [ 'status', [
55
+            ['status', [
56 56
                 'target' => new StatusAwareEntity(),
57 57
                 'value' => 'state',
58
-                'setter_exception' => [ 'RuntimeException', 'No status entity' ]
58
+                'setter_exception' => ['RuntimeException', 'No status entity']
59 59
             ]],
60 60
 
61
-            [ 'status', [
61
+            ['status', [
62 62
                 'target' => new StatusAwareEntity(),
63 63
                 'value' => new Status(Status::STATE_TWO),
64 64
                 'getter_method' => 'has*',
65
-                'getter_args' => [ Status::STATE_TWO ],
65
+                'getter_args' => [Status::STATE_TWO],
66 66
                 'expect' => true,
67 67
             ]],
68 68
         ];
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Entity/EntityTraitTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
         $countable = new \ArrayObject(['not', 'empty']);
48 48
 
49 49
         return [
50
-            [ null, false ],
51
-            [ '', false ],
52
-            [ 'something', true],
53
-            [ 0, false ],
54
-            [ 1, true ],
55
-            [ false, false ],
56
-            [ true, true ],
57
-            [ [], false ],
58
-            [ ['not', 'empty'], true ],
59
-            [ new \stdClass(), true ],
60
-            [ $emptyCountable, false ],
61
-            [ $countable, true ],
62
-            [ self::$fileResource, true ],
50
+            [null, false],
51
+            ['', false],
52
+            ['something', true],
53
+            [0, false],
54
+            [1, true],
55
+            [false, false],
56
+            [true, true],
57
+            [[], false],
58
+            [['not', 'empty'], true],
59
+            [new \stdClass(), true],
60
+            [$emptyCountable, false],
61
+            [$countable, true],
62
+            [self::$fileResource, true],
63 63
 
64 64
         ];
65 65
     }
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
         $setterTarget = new HasPropertyAndSetterTestTraitEntity();
107 107
         $strictTarget = new HasPropertyAndGetterAndSetterTestTraitEntity();
108 108
         return [
109
-            [ $facileTarget, [true, false ,false, false]],
110
-            [ $getterTarget, [true, true, false, false]],
111
-            [ $setterTarget, [true, false, true, false]],
112
-            [ $strictTarget, [true, true, true, true]],
109
+            [$facileTarget, [true, false, false, false]],
110
+            [$getterTarget, [true, true, false, false]],
111
+            [$setterTarget, [true, false, true, false]],
112
+            [$strictTarget, [true, true, true, true]],
113 113
         ];
114 114
     }
115 115
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         foreach ($modes  as $mode) {
130 130
             $actual = $target->hasProperty('testProperty', $mode);
131 131
             $expect = array_shift($expects);
132
-            $assert = 'assert' . ($expect ? 'true' : 'false');
132
+            $assert = 'assert'.($expect ? 'true' : 'false');
133 133
 
134 134
             $this->$assert($actual);
135 135
         }
Please login to merge, or discard this patch.