Completed
Pull Request — develop (#542)
by Mathias
09:01
created
Core/test/CoreTest/Factory/Paginator/RepositoryAbstractFactoryTest.php 1 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 1 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.
module/Core/test/CoreTest/Mail/StringTemplateMessageTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
         $addressList = new AddressList();
68 68
         $addressValue = ArrayUtils::iteratorToArray($addressList);
69 69
         return [
70
-            ['variables',[
70
+            ['variables', [
71 71
                 'value' => ['some' => 'value'],
72 72
                 'default' => [],
73 73
             ]],
74
-            ['variables',[
74
+            ['variables', [
75 75
                 'value' => $this,
76 76
                 'setter_exception' => [
77 77
                     \InvalidArgumentException::class,
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
                 ],
80 80
 
81 81
             ]],
82
-            ['variables',[
82
+            ['variables', [
83 83
                 'value' => $addressList,
84 84
                 'expect' => $addressValue
85 85
             ]],
86
-            ['template',[
86
+            ['template', [
87 87
                 'value' => 'some-template',
88 88
                 'default' => null
89 89
             ]],
90
-            ['callbacks',[
90
+            ['callbacks', [
91 91
                 'value' => [
92
-                    'some' => [$this,'someCallback']
92
+                    'some' => [$this, 'someCallback']
93 93
                 ],
94 94
                 'default' => array(),
95 95
             ]],
96
-            ['callbacks',[
96
+            ['callbacks', [
97 97
                 'value' => $this,
98 98
                 'setter_exception' => [
99 99
                     \InvalidArgumentException::class,
100 100
                     'Expect an array or an instance of \Traversable, but received'
101 101
                 ]
102 102
             ]],
103
-            ['callbacks',[
103
+            ['callbacks', [
104 104
                 'value' => [
105
-                    'uncallable' => [$this,'notCallable']
105
+                    'uncallable' => [$this, 'notCallable']
106 106
                 ],
107 107
                 'setter_exception' => [
108 108
                     \InvalidArgumentException::class,
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     public function testGetBodyText()
116 116
     {
117 117
         $translator = $this->createMock(TranslatorInterface::class);
118
-        $target =  new StringTemplateMessage();
118
+        $target = new StringTemplateMessage();
119 119
         $target->setTranslator($translator);
120 120
 
121 121
         $translator->expects($this->any())
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             trim($target->getSubject())
156 156
         );
157 157
 
158
-        $target->setCallback('callback', function () {
158
+        $target->setCallback('callback', function() {
159 159
             return 'Hello From Callback!';
160 160
         });
161 161
         $target->setCallback('object', 'getSubject');
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Mail/FileTransportTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $options = $this->createMock(FileOptions::class);
36 36
         $options->expects($this->once())
37 37
             ->method('getCallback')
38
-            ->willReturn([$this,'getFileName'])
38
+            ->willReturn([$this, 'getFileName'])
39 39
         ;
40 40
         $options->expects($this->exactly(2))
41 41
             ->method('getPath')
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Mail/TranslatorAwareMessageTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@
 block discarded – undo
38 38
      */
39 39
     private $target = TranslatorAwareMessage::class;
40 40
 
41
-    private $inheritance = [ Message::class, TranslatorAwareInterface::class ];
41
+    private $inheritance = [Message::class, TranslatorAwareInterface::class];
42 42
 
43 43
     public function propertiesProvider()
44 44
     {
45
-        $setTranslator = function () {
45
+        $setTranslator = function() {
46 46
             $this->target->setTranslator(new Translator());
47 47
         };
48 48
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Mail/MailServiceFactoryTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
             ->method('get')
49 49
             ->willReturnMap(
50 50
                 [
51
-                    ['Config',[]],
52
-                    ['Auth/Options',$authOptions],
53
-                    ['Core/MailServiceOptions',$mailOptions]
51
+                    ['Config', []],
52
+                    ['Auth/Options', $authOptions],
53
+                    ['Core/MailServiceOptions', $mailOptions]
54 54
             ]
55 55
         );
56 56
 
Please login to merge, or discard this patch.