@@ -51,7 +51,7 @@ |
||
| 51 | 51 | ])); |
| 52 | 52 | |
| 53 | 53 | $factory = new ApplicationListenerFactory(); |
| 54 | - $listener = $factory->__invoke($serviceLocator,'irrelevant'); |
|
| 54 | + $listener = $factory->__invoke($serviceLocator, 'irrelevant'); |
|
| 55 | 55 | $this->assertInstanceOf(ApplicationListener::class, $listener); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $view = $this->getMockBuilder(View::class) |
| 91 | 91 | ->getMock(); |
| 92 | 92 | |
| 93 | - $actual = $this->listListener->getItems($user, $view , 10); |
|
| 93 | + $actual = $this->listListener->getItems($user, $view, 10); |
|
| 94 | 94 | |
| 95 | 95 | $this->assertInternalType('array', $actual); |
| 96 | 96 | $this->assertCount($expected, $actual); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $pluginManager->expects($this->any()) |
| 104 | 104 | ->method('get') |
| 105 | 105 | ->willReturnMap([ |
| 106 | - ['params',null,$params] |
|
| 106 | + ['params', null, $params] |
|
| 107 | 107 | ]) |
| 108 | 108 | ; |
| 109 | 109 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $plugins->expects($this->any()) |
| 127 | 127 | ->method('get') |
| 128 | 128 | ->willReturnMap([ |
| 129 | - ['params',null,$params] |
|
| 129 | + ['params', null, $params] |
|
| 130 | 130 | ]) |
| 131 | 131 | ; |
| 132 | 132 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $plugins->expects($this->any()) |
| 151 | 151 | ->method('get') |
| 152 | 152 | ->willReturnMap([ |
| 153 | - ['params',null,$params] |
|
| 153 | + ['params', null, $params] |
|
| 154 | 154 | ]) |
| 155 | 155 | ; |
| 156 | 156 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $pluginManager->expects($this->any()) |
| 183 | 183 | ->method('get') |
| 184 | 184 | ->willReturnMap([ |
| 185 | - ['params',null,$params] |
|
| 185 | + ['params', null, $params] |
|
| 186 | 186 | ]) |
| 187 | 187 | ; |
| 188 | 188 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $pluginManager->expects($this->any()) |
| 218 | 218 | ->method('get') |
| 219 | 219 | ->willReturnMap([ |
| 220 | - ['params',null,$params] |
|
| 220 | + ['params', null, $params] |
|
| 221 | 221 | ]) |
| 222 | 222 | ; |
| 223 | 223 | |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | if (in_array('userTokenGenerator', $mocks)) { |
| 63 | 63 | $this->userTokenGeneratorMock = $this->getMockBuilder('\Auth\Service\UserUniqueTokenGenerator') |
| 64 | - ->disableOriginalConstructor()->getMock(); |
|
| 64 | + ->disableOriginalConstructor()->getMock(); |
|
| 65 | 65 | } |
| 66 | 66 | if (in_array('mailerPlugin', $mocks)) { |
| 67 | 67 | $this->mailerPluginMock = $this->getMockBuilder('\Core\Controller\Plugin\Mailer') |
| 68 | - ->disableOriginalConstructor()->getMock(); |
|
| 68 | + ->disableOriginalConstructor()->getMock(); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if ($inject) { |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | $email = 'invalidEmailAddress'; |
| 134 | 134 | $message = 'Email address is invalid.'; |
| 135 | 135 | $this->translatorMock->expects($this->exactly(5)) |
| 136 | - ->method('translate') |
|
| 137 | - ->with($message) |
|
| 138 | - ->will($this->returnArgument(0)); |
|
| 136 | + ->method('translate') |
|
| 137 | + ->with($message) |
|
| 138 | + ->will($this->returnArgument(0)); |
|
| 139 | 139 | |
| 140 | 140 | $expected = array( |
| 141 | 141 | 'ok' => false, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $user->getInfo()->setEmail($email); |
| 161 | 161 | |
| 162 | 162 | $this->userRepositoryMock->expects($this->once())->method('findByEmail')->with($email, null) |
| 163 | - ->willReturn($user); |
|
| 163 | + ->willReturn($user); |
|
| 164 | 164 | $this->userRepositoryMock->expects($this->never())->method('create'); |
| 165 | 165 | $this->userTokenGeneratorMock->expects($this->once())->method('generate')->with($user, 7)->willReturn('testToken'); |
| 166 | 166 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $user->getInfo()->setEmail($email); |
| 193 | 193 | |
| 194 | 194 | $this->userRepositoryMock->expects($this->once())->method('findByEmail')->with($email, null) |
| 195 | - ->willReturn(null); |
|
| 195 | + ->willReturn(null); |
|
| 196 | 196 | $this->userRepositoryMock->expects($this->once())->method('create')->willReturn($user); |
| 197 | 197 | $this->userTokenGeneratorMock->expects($this->once())->method('generate')->with($user, 7)->willReturn('testToken'); |
| 198 | 198 | |
@@ -227,12 +227,12 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | $message = 'Sending invitation mail failed.'; |
| 229 | 229 | $this->translatorMock->expects($this->once()) |
| 230 | - ->method('translate') |
|
| 231 | - ->with($message) |
|
| 232 | - ->will($this->returnArgument(0)); |
|
| 230 | + ->method('translate') |
|
| 231 | + ->with($message) |
|
| 232 | + ->will($this->returnArgument(0)); |
|
| 233 | 233 | |
| 234 | 234 | $this->userRepositoryMock->expects($this->once())->method('findByEmail')->with($email, null) |
| 235 | - ->willReturn($user); |
|
| 235 | + ->willReturn($user); |
|
| 236 | 236 | $this->userRepositoryMock->expects($this->never())->method('create'); |
| 237 | 237 | $this->userTokenGeneratorMock->expects($this->once())->method('generate')->with($user, 7)->willReturn('testToken'); |
| 238 | 238 | |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | ->disableOriginalConstructor()->getMock(); |
| 65 | 65 | } |
| 66 | 66 | if (in_array('mailerPlugin', $mocks)) { |
| 67 | - $this->mailerPluginMock = $this->getMockBuilder('\Core\Controller\Plugin\Mailer') |
|
| 67 | + $this->mailerPluginMock = $this->getMockBuilder('\Core\Controller\Plugin\Mailer') |
|
| 68 | 68 | ->disableOriginalConstructor()->getMock(); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if ($inject) { |
| 72 | 72 | foreach ($mocks as $key) { |
| 73 | - $setter = 'set' . $key; |
|
| 74 | - $this->target->$setter($this->{$key . 'Mock'}); |
|
| 73 | + $setter = 'set'.$key; |
|
| 74 | + $this->target->$setter($this->{$key.'Mock'}); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $this->setupMocks($mockKey); |
| 108 | 108 | |
| 109 | - $setter = 'set' . ucfirst($mockKey); |
|
| 110 | - $getter = 'get' . ucfirst($mockKey); |
|
| 111 | - $value = $this->{$mockKey . 'Mock'}; |
|
| 109 | + $setter = 'set'.ucfirst($mockKey); |
|
| 110 | + $getter = 'get'.ucfirst($mockKey); |
|
| 111 | + $value = $this->{$mockKey.'Mock'}; |
|
| 112 | 112 | |
| 113 | 113 | $this->assertSame($this->target, $this->target->$setter($value), 'Fluent interface broken!'); |
| 114 | 114 | $this->assertSame($value, $this->target->$getter()); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function testGetterThrowExceptionIfDependencyMissing($getterName) |
| 124 | 124 | { |
| 125 | - $getter = "get" . $getterName; |
|
| 125 | + $getter = "get".$getterName; |
|
| 126 | 126 | |
| 127 | 127 | $this->target->$getter(); |
| 128 | 128 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'message' => $message, |
| 143 | 143 | ); |
| 144 | 144 | |
| 145 | - foreach (array($email, null, '', 0, array()) as $testEmail) { |
|
| 145 | + foreach (array($email, null, '', 0, array()) as $testEmail) { |
|
| 146 | 146 | $result = $this->target->process($testEmail); |
| 147 | 147 | |
| 148 | 148 | $this->assertEquals($expected, $result); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $this->authMock = $this->getMockBuilder('\Auth\AuthenticationService')->disableOriginalConstructor()->getMock(); |
| 49 | 49 | $this->organizationRepositoryMock = $this->getMockBuilder('Organizations\Repository\Organization') |
| 50 | - ->disableOriginalConstructor()->getMock(); |
|
| 50 | + ->disableOriginalConstructor()->getMock(); |
|
| 51 | 51 | $this->userRepositoryMock = $this->getMockBuilder('\Auth\Repository\User')->disableOriginalConstructor()->getMock(); |
| 52 | 52 | |
| 53 | 53 | if (false !== strpos($this->getName(false), 'Setter')) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $employee->expects($this->once())->method('setStatus')->with(Employee::STATUS_ASSIGNED); |
| 77 | 77 | |
| 78 | 78 | $this->organizationMock->expects($this->once())->method('getEmployee')->with($this->userMock->getId()) |
| 79 | - ->willReturn($employee); |
|
| 79 | + ->willReturn($employee); |
|
| 80 | 80 | |
| 81 | 81 | $this->organizationMock->expects($this->any())->method('getId')->willReturn('testOrgId'); |
| 82 | 82 | $this->userRepositoryMock->expects($this->once())->method('findByToken')->with('testToken')->willReturn($this->userMock); |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | ->willReturn($unassignedEmp); |
| 104 | 104 | |
| 105 | 105 | $this->organizationRepositoryMock->expects($this->once()) |
| 106 | - ->method('findPendingOrganizationsByEmployee') |
|
| 107 | - ->with($this->userMock->getId()) |
|
| 108 | - ->willReturn(array($sameOrganization, $assignedEmpOrganization, $unassignedEmpOrganization)); |
|
| 106 | + ->method('findPendingOrganizationsByEmployee') |
|
| 107 | + ->with($this->userMock->getId()) |
|
| 108 | + ->willReturn(array($sameOrganization, $assignedEmpOrganization, $unassignedEmpOrganization)); |
|
| 109 | 109 | |
| 110 | 110 | $storageMock = $this->getMockForAbstractClass('\Zend\Authentication\Storage\StorageInterface'); |
| 111 | 111 | $storageMock->expects($this->once())->method('write')->with($this->userMock->getId()); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $orgRef = $this->getMockBuilder('\Organizations\Entity\OrganizationReference')->disableOriginalConstructor()->getMock(); |
| 178 | 178 | $orgRef->expects($this->once())->method('hasAssociation')->willReturn(true); |
| 179 | 179 | $orgRef->expects($this->once())->method('getEmployee')->with($this->userMock->getId()) |
| 180 | - ->willReturn($empMock); |
|
| 180 | + ->willReturn($empMock); |
|
| 181 | 181 | |
| 182 | 182 | $this->userMock->setOrganization($orgRef); |
| 183 | 183 | |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | continue; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $this->fail('Expected exception was not thrown for "' . $method . '"'); |
|
| 137 | + $this->fail('Expected exception was not thrown for "'.$method.'"'); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -59,31 +59,31 @@ |
||
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | $plugins = $this |
| 62 | - ->getMockBuilder('\Zend\Mvc\Controller\PluginManager') |
|
| 63 | - ->disableOriginalConstructor() |
|
| 64 | - ->getMock() |
|
| 62 | + ->getMockBuilder('\Zend\Mvc\Controller\PluginManager') |
|
| 63 | + ->disableOriginalConstructor() |
|
| 64 | + ->getMock() |
|
| 65 | 65 | ; |
| 66 | 66 | $plugins |
| 67 | - ->expects($this->any()) |
|
| 68 | - ->method('get') |
|
| 69 | - ->will($this->returnCallback(array($this, 'retrievePluginMock'))) |
|
| 67 | + ->expects($this->any()) |
|
| 68 | + ->method('get') |
|
| 69 | + ->will($this->returnCallback(array($this, 'retrievePluginMock'))) |
|
| 70 | 70 | ; |
| 71 | 71 | |
| 72 | 72 | $this->target->setPluginManager($plugins); |
| 73 | 73 | |
| 74 | 74 | $params = $this->getMockBuilder('\Zend\Mvc\Controller\Plugin\Params') |
| 75 | - ->disableOriginalConstructor() |
|
| 76 | - ->getMock() |
|
| 75 | + ->disableOriginalConstructor() |
|
| 76 | + ->getMock() |
|
| 77 | 77 | ; |
| 78 | 78 | $params |
| 79 | - ->expects($this->any()) |
|
| 80 | - ->method('__invoke') |
|
| 81 | - ->will($this->returnSelf()) |
|
| 79 | + ->expects($this->any()) |
|
| 80 | + ->method('__invoke') |
|
| 81 | + ->will($this->returnSelf()) |
|
| 82 | 82 | ; |
| 83 | 83 | $params |
| 84 | - ->expects($this->any()) |
|
| 85 | - ->method('fromQuery') |
|
| 86 | - ->will($this->returnCallback(array($this, 'retrieveQueryParam'))) |
|
| 84 | + ->expects($this->any()) |
|
| 85 | + ->method('fromQuery') |
|
| 86 | + ->will($this->returnCallback(array($this, 'retrieveQueryParam'))) |
|
| 87 | 87 | ; |
| 88 | 88 | |
| 89 | 89 | $this->pluginsMockMap['params'] = $params; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return isset($this->pluginsMockMap[$name]) ? $this->pluginsMockMap[$name] : null; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - public function retrieveQueryParam($name, $default=null) |
|
| 97 | + public function retrieveQueryParam($name, $default = null) |
|
| 98 | 98 | { |
| 99 | 99 | return isset($this->queryParams[$name]) ? $this->queryParams[$name] : $default; |
| 100 | 100 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | private function setupOrganizationEntityRetrievalMocks($name) |
| 129 | 129 | { |
| 130 | - $id = $name. "Id"; |
|
| 130 | + $id = $name."Id"; |
|
| 131 | 131 | $organization = new Organization(); |
| 132 | 132 | $organization->setOrganizationName(new OrganizationName($name)); |
| 133 | 133 | |
@@ -35,16 +35,16 @@ |
||
| 35 | 35 | $container->expects($this->any()) |
| 36 | 36 | ->method('get') |
| 37 | 37 | ->willReturnMap([ |
| 38 | - ['Core/RepositoryService',$container], |
|
| 39 | - ['Jobs/Job',$jobRepository], |
|
| 40 | - ['AuthenticationService',$auth] |
|
| 38 | + ['Core/RepositoryService', $container], |
|
| 39 | + ['Jobs/Job', $jobRepository], |
|
| 40 | + ['AuthenticationService', $auth] |
|
| 41 | 41 | ]) |
| 42 | 42 | ; |
| 43 | 43 | |
| 44 | - $factory = new PaginationQueryFactory($auth,$jobRepository); |
|
| 44 | + $factory = new PaginationQueryFactory($auth, $jobRepository); |
|
| 45 | 45 | $this->assertInstanceOf( |
| 46 | 46 | PaginationQuery::class, |
| 47 | - $factory($container,'some-name') |
|
| 47 | + $factory($container, 'some-name') |
|
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $builder->expects($this->once()) |
| 45 | 45 | ->method('in') |
| 46 | - ->with([Status::ACTIVE,Status::PUBLISH]) |
|
| 46 | + ->with([Status::ACTIVE, Status::PUBLISH]) |
|
| 47 | 47 | ->willReturn($builder) |
| 48 | 48 | ; |
| 49 | 49 | $builder->expects($this->exactly(2)) |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ; |
| 57 | 57 | |
| 58 | 58 | |
| 59 | - $params=['organization_id' =>$organization->getId()]; |
|
| 60 | - $target->createQuery($params,$builder); |
|
| 59 | + $params = ['organization_id' =>$organization->getId()]; |
|
| 60 | + $target->createQuery($params, $builder); |
|
| 61 | 61 | } |
| 62 | 62 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $this->jobRepository = $this->createMock(JobRepository::class); |
| 58 | 58 | $this->authService = $this->createMock(AuthenticationService::class); |
| 59 | - $this->target = new PaginationQuery($this->jobRepository,$this->authService); |
|
| 59 | + $this->target = new PaginationQuery($this->jobRepository, $this->authService); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function testCreateQuery() |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $builder->expects($this->any()) |
| 78 | 78 | ->method('field') |
| 79 | 79 | ->willReturnMap([ |
| 80 | - ['permissions.view',$builder] |
|
| 80 | + ['permissions.view', $builder] |
|
| 81 | 81 | ]) |
| 82 | 82 | ; |
| 83 | 83 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $params = [ |
| 96 | 96 | 'q' => 'some text' |
| 97 | 97 | ]; |
| 98 | - $target->createQuery($params,$builder); |
|
| 98 | + $target->createQuery($params, $builder); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function testCreateQueryForProfile() |
@@ -120,20 +120,20 @@ discard block |
||
| 120 | 120 | $builder->expects($this->any()) |
| 121 | 121 | ->method('field') |
| 122 | 122 | ->willReturnMap([ |
| 123 | - ['profileSetting',$builder], |
|
| 124 | - ['id',$builder], |
|
| 125 | - ['organization',$builder], |
|
| 126 | - ['status.name',$builder], |
|
| 127 | - ['isDraft',$builder], |
|
| 128 | - ['profileSetting',$builder] |
|
| 123 | + ['profileSetting', $builder], |
|
| 124 | + ['id', $builder], |
|
| 125 | + ['organization', $builder], |
|
| 126 | + ['status.name', $builder], |
|
| 127 | + ['isDraft', $builder], |
|
| 128 | + ['profileSetting', $builder] |
|
| 129 | 129 | ]) |
| 130 | 130 | ; |
| 131 | 131 | |
| 132 | 132 | $builder->expects($this->exactly(2)) |
| 133 | 133 | ->method('notIn') |
| 134 | 134 | ->willReturnMap([ |
| 135 | - [ [StatusInterface::EXPIRED, StatusInterface::INACTIVE], $builder], |
|
| 136 | - [ ['some-id'],$builder ] |
|
| 135 | + [[StatusInterface::EXPIRED, StatusInterface::INACTIVE], $builder], |
|
| 136 | + [['some-id'], $builder] |
|
| 137 | 137 | ]) |
| 138 | 138 | ; |
| 139 | 139 | |
@@ -175,6 +175,6 @@ discard block |
||
| 175 | 175 | $params = new Parameters([ |
| 176 | 176 | 'type' => 'profile' |
| 177 | 177 | ]); |
| 178 | - $target->createQuery($params,$builder); |
|
| 178 | + $target->createQuery($params, $builder); |
|
| 179 | 179 | } |
| 180 | 180 | } |