@@ -41,11 +41,11 @@ |
||
| 41 | 41 | private $target = [ |
| 42 | 42 | UserSwitcherFactory::class, |
| 43 | 43 | '@testCreateServiceInvokesItself' => [ |
| 44 | - 'mock' => [ '__invoke' ], |
|
| 44 | + 'mock' => ['__invoke'], |
|
| 45 | 45 | ], |
| 46 | 46 | ]; |
| 47 | 47 | |
| 48 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 48 | + private $inheritance = [FactoryInterface::class]; |
|
| 49 | 49 | |
| 50 | 50 | public function testCreateServiceInvokesItself() |
| 51 | 51 | { |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | ->getMock(); |
| 84 | 84 | $this->serviceManager->expects($this->any()) |
| 85 | 85 | ->method('get') |
| 86 | - ->will($this->returnCallback(function ($name) { |
|
| 86 | + ->will($this->returnCallback(function($name) { |
|
| 87 | 87 | switch ($name) { |
| 88 | 88 | case 'AuthenticationService': |
| 89 | 89 | return $this->auth; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | public function testProceed_WhenUserAlreadyExists() |
| 116 | 116 | { |
| 117 | 117 | $name = uniqid('name'); |
| 118 | - $email = uniqid('email') . '@' . uniqid('host') . '.com.pl'; |
|
| 118 | + $email = uniqid('email').'@'.uniqid('host').'.com.pl'; |
|
| 119 | 119 | $user = UserEntityProvider::createEntityWithRandomData(); |
| 120 | 120 | $role = 'user'; |
| 121 | 121 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function testProceed($role) |
| 162 | 162 | { |
| 163 | - $name = uniqid('name') . ' ' . uniqid('surname'); |
|
| 164 | - $email = uniqid('email') . '@' . uniqid('host') . '.com.pl'; |
|
| 163 | + $name = uniqid('name').' '.uniqid('surname'); |
|
| 164 | + $email = uniqid('email').'@'.uniqid('host').'.com.pl'; |
|
| 165 | 165 | $user = UserEntityProvider::createEntityWithRandomData(); |
| 166 | 166 | $confirmationLink = uniqid('confirmationLink'); |
| 167 | 167 | $self = $this; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $this->userRepositoryMock->expects($this->once()) |
| 196 | 196 | ->method('store') |
| 197 | - ->with($this->callback(function ($user) { |
|
| 197 | + ->with($this->callback(function($user) { |
|
| 198 | 198 | return $user instanceof User ? true:false; |
| 199 | 199 | })); |
| 200 | 200 | |
@@ -83,20 +83,20 @@ discard block |
||
| 83 | 83 | $options = new CaptchaOptions(); |
| 84 | 84 | $options->setMode("reCaptcha"); |
| 85 | 85 | $testedObject = new Register(null, $options); |
| 86 | - $captchaInput= $testedObject->get('captcha'); |
|
| 86 | + $captchaInput = $testedObject->get('captcha'); |
|
| 87 | 87 | $this->assertInstanceOf('Zend\Form\Element\Captcha', $captchaInput); |
| 88 | 88 | $this->assertInstanceOf('Zend\Captcha\ReCaptcha', $captchaInput->getOption('captcha')); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | public function testWithImageField() |
| 92 | 92 | { |
| 93 | - if (! function_exists("imageftbbox")) { |
|
| 93 | + if (!function_exists("imageftbbox")) { |
|
| 94 | 94 | return $this->markTestSkipped('This test requires GD FT fonts support'); |
| 95 | 95 | } |
| 96 | 96 | $options = new CaptchaOptions(); |
| 97 | 97 | $options->setMode("image"); |
| 98 | 98 | $testedObject = new Register(null, $options); |
| 99 | - $captchaInput= $testedObject->get('captcha'); |
|
| 99 | + $captchaInput = $testedObject->get('captcha'); |
|
| 100 | 100 | $this->assertInstanceOf('Zend\Captcha\Image', $captchaInput->getOption('captcha')); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -105,6 +105,6 @@ discard block |
||
| 105 | 105 | $options = new CaptchaOptions(); |
| 106 | 106 | $testedObject = new Register(null, $options, 'user'); |
| 107 | 107 | $roleField = $testedObject->get('register')->get('role'); |
| 108 | - $this->assertTrue($roleField->getValue() =='user'); |
|
| 108 | + $this->assertTrue($roleField->getValue() == 'user'); |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | // This should be an array of module namespaces used in the application. |
| 7 | 7 | |
| 8 | 8 | use PHPUnit\Framework\TestCase; |
| 9 | - 'modules' => array_merge($commonModules,array( |
|
| 9 | + 'modules' => array_merge($commonModules, array( |
|
| 10 | 10 | 'Core', |
| 11 | 11 | 'Auth', |
| 12 | 12 | 'Jobs', |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | ]; |
| 55 | 55 | |
| 56 | 56 | /** @noinspection PhpUnusedPrivateFieldInspection */ |
| 57 | - private $inheritance = [ EventSubscriber::class ]; |
|
| 57 | + private $inheritance = [EventSubscriber::class]; |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | private function getTarget() |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function testSubscribesToOnFlushEvent() |
| 68 | 68 | { |
| 69 | - $this->assertEquals([ Events::onFlush ], $this->target->getSubscribedEvents()); |
|
| 69 | + $this->assertEquals([Events::onFlush], $this->target->getSubscribedEvents()); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function testUpdatesFilesPermissionsOnFlush() |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | $document->singleFile = $file; |
| 100 | 100 | $document->fileCollection = $collection; |
| 101 | 101 | |
| 102 | - $inserts = [ $document ]; |
|
| 103 | - $updates = [ $document ]; |
|
| 102 | + $inserts = [$document]; |
|
| 103 | + $updates = [$document]; |
|
| 104 | 104 | |
| 105 | 105 | $filePermissions->expects($this->exactly(4))->method('clear')->will($this->returnSelf()); |
| 106 | 106 | $filePermissions->expects($this->exactly(4))->method('inherit')->with($permissions)->will($this->returnSelf()); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | class ConcreteUpdateFilesPermissionsSubScriber extends AbstractUpdateFilesPermissionsSubscriber |
| 159 | 159 | { |
| 160 | - protected $filesProperties = [ 'singleFile', 'fileCollection' ]; |
|
| 160 | + protected $filesProperties = ['singleFile', 'fileCollection']; |
|
| 161 | 161 | protected $targetDocument = Ufps_TargetDocument::class; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $translator->expects($this->once()) |
| 102 | 102 | ->method('translate') |
| 103 | 103 | ->willReturnMap([ |
| 104 | - ['some message','default','translated some message'], |
|
| 104 | + ['some message', 'default', 'translated some message'], |
|
| 105 | 105 | ]) |
| 106 | 106 | ; |
| 107 | 107 | $listener->expects($this->exactly(2)) |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ->willReturn($mock) |
| 138 | 138 | ; |
| 139 | 139 | |
| 140 | - $callback = array($mock,$method); |
|
| 140 | + $callback = array($mock, $method); |
|
| 141 | 141 | $this->assertSame( |
| 142 | 142 | $mock, |
| 143 | 143 | call_user_func($callback, $message) |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | public function getTestCreateNamespacedMessages() |
| 148 | 148 | { |
| 149 | 149 | return [ |
| 150 | - ['info','info message'], |
|
| 151 | - ['warning','warning message'], |
|
| 152 | - ['success','success message'], |
|
| 153 | - ['danger','danger message'], |
|
| 154 | - ['error','error message'] |
|
| 150 | + ['info', 'info message'], |
|
| 151 | + ['warning', 'warning message'], |
|
| 152 | + ['success', 'success message'], |
|
| 153 | + ['danger', 'danger message'], |
|
| 154 | + ['error', 'error message'] |
|
| 155 | 155 | ]; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | $events->expects($this->exactly(2)) |
| 175 | 175 | ->method('getNotifications') |
| 176 | 176 | ->willReturnOnConsecutiveCalls( |
| 177 | - [],// setup for empty array test |
|
| 178 | - [$entity1,$entity2] // setup for non empty array tests |
|
| 177 | + [], // setup for empty array test |
|
| 178 | + [$entity1, $entity2] // setup for non empty array tests |
|
| 179 | 179 | ) |
| 180 | 180 | ; |
| 181 | 181 | |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | $mock->expects($this->exactly(2)) |
| 193 | 193 | ->method('renderMessage') |
| 194 | 194 | ->withConsecutive( |
| 195 | - ['some notification',Notification::NAMESPACE_INFO], |
|
| 196 | - ['some notification',Notification::NAMESPACE_DANGER] |
|
| 195 | + ['some notification', Notification::NAMESPACE_INFO], |
|
| 196 | + ['some notification', Notification::NAMESPACE_DANGER] |
|
| 197 | 197 | ) |
| 198 | 198 | ; |
| 199 | 199 | $mock->createOutput($events); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $mock = $this->getMockBuilder(PaginationParams::class) |
| 64 | 64 | ->disableOriginalConstructor() |
| 65 | - ->setMethods(['getParams','getList']) |
|
| 65 | + ->setMethods(['getParams', 'getList']) |
|
| 66 | 66 | ->getMock() |
| 67 | 67 | ; |
| 68 | 68 | $repository = $this->createMock(RepositoryInterface::class); |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | $mock->expects($this->exactly(2)) |
| 79 | 79 | ->method('getList') |
| 80 | 80 | ->withConsecutive( |
| 81 | - ['some/namespace',[$this,'methodToTest']], |
|
| 82 | - ['some/namespace',$repository] |
|
| 81 | + ['some/namespace', [$this, 'methodToTest']], |
|
| 82 | + ['some/namespace', $repository] |
|
| 83 | 83 | ) |
| 84 | 84 | ->willReturn('getList called') |
| 85 | 85 | ; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ); |
| 98 | 98 | $this->assertEquals( |
| 99 | 99 | 'getList called', |
| 100 | - $mock('some/namespace', [$this,'methodToTest']), |
|
| 100 | + $mock('some/namespace', [$this, 'methodToTest']), |
|
| 101 | 101 | '__invoke() should call ::getList when defaults is callable' |
| 102 | 102 | ); |
| 103 | 103 | $this->assertEquals( |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $session->list = null; |
| 180 | 180 | $mock = $this->target; |
| 181 | 181 | |
| 182 | - $callback = [$this,'methodToTest']; |
|
| 182 | + $callback = [$this, 'methodToTest']; |
|
| 183 | 183 | $output = $mock->getList('namespace', $callback); |
| 184 | 184 | $this->assertEquals( |
| 185 | 185 | 'methodToTest called', |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | ->willReturn('next') |
| 223 | 223 | ; |
| 224 | 224 | $this->assertEquals( |
| 225 | - ['previous','next'], |
|
| 225 | + ['previous', 'next'], |
|
| 226 | 226 | $mock->getNeighbours('namespace', 'callback', 'id') |
| 227 | 227 | ); |
| 228 | 228 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | ->method('trigger') |
| 50 | 50 | ->with($event, 'some_target') |
| 51 | 51 | ->willReturn([ |
| 52 | - 'test_template',$viewModel |
|
| 52 | + 'test_template', $viewModel |
|
| 53 | 53 | ]) |
| 54 | 54 | ; |
| 55 | 55 | |