@@ -70,13 +70,13 @@ |
||
70 | 70 | $app = new Application(); |
71 | 71 | $app2 = new Application(); |
72 | 72 | $app2->getPermissions()->grant($user, PermissionsInterface::PERMISSION_VIEW) |
73 | - ->grant($user2, PermissionsInterface::PERMISSION_CHANGE); |
|
73 | + ->grant($user2, PermissionsInterface::PERMISSION_CHANGE); |
|
74 | 74 | |
75 | 75 | $app3 = new Application(); |
76 | 76 | $app3->setIsDraft(true); |
77 | 77 | //$app3->setUser($user); |
78 | 78 | $app3->getPermissions()->grant($user, PermissionsInterface::PERMISSION_VIEW) |
79 | - ->grant($user2, PermissionsInterface::PERMISSION_CHANGE); |
|
79 | + ->grant($user2, PermissionsInterface::PERMISSION_CHANGE); |
|
80 | 80 | |
81 | 81 | return array( |
82 | 82 | 'nouser-noapp' => array($role, $resource, null, false), |
@@ -89,8 +89,8 @@ |
||
89 | 89 | 'change-not-granted2' => array($user, $app2, 'change', false), |
90 | 90 | 'subsequentAttachmentUpload-not-granted' => array($user, $app, Application::PERMISSION_SUBSEQUENT_ATTACHMENT_UPLOAD, false), |
91 | 91 | 'subsequentAttachmentUpload-granted' => array($user, $app2, Application::PERMISSION_SUBSEQUENT_ATTACHMENT_UPLOAD, true), |
92 | - 'allow-draft-view' => [ $user2, $app3, 'change', true ], |
|
93 | - 'disallow-draft-view' => [ $user, $app3, 'change', false ], |
|
92 | + 'allow-draft-view' => [$user2, $app3, 'change', true], |
|
93 | + 'disallow-draft-view' => [$user, $app3, 'change', false], |
|
94 | 94 | |
95 | 95 | ); |
96 | 96 | } |
@@ -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 |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | ->disableOriginalConstructor()->getMock(); |
66 | 66 | } |
67 | 67 | if (in_array('mailerPlugin', $mocks)) { |
68 | - $this->mailerPluginMock = $this->getMockBuilder('\Core\Controller\Plugin\Mailer') |
|
68 | + $this->mailerPluginMock = $this->getMockBuilder('\Core\Controller\Plugin\Mailer') |
|
69 | 69 | ->disableOriginalConstructor()->getMock(); |
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($inject) { |
73 | 73 | foreach ($mocks as $key) { |
74 | - $setter = 'set' . $key; |
|
75 | - $this->target->$setter($this->{$key . 'Mock'}); |
|
74 | + $setter = 'set'.$key; |
|
75 | + $this->target->$setter($this->{$key.'Mock'}); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | { |
108 | 108 | $this->setupMocks($mockKey); |
109 | 109 | |
110 | - $setter = 'set' . ucfirst($mockKey); |
|
111 | - $getter = 'get' . ucfirst($mockKey); |
|
112 | - $value = $this->{$mockKey . 'Mock'}; |
|
110 | + $setter = 'set'.ucfirst($mockKey); |
|
111 | + $getter = 'get'.ucfirst($mockKey); |
|
112 | + $value = $this->{$mockKey.'Mock'}; |
|
113 | 113 | |
114 | 114 | $this->assertSame($this->target, $this->target->$setter($value), 'Fluent interface broken!'); |
115 | 115 | $this->assertSame($value, $this->target->$getter()); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function testGetterThrowExceptionIfDependencyMissing($getterName) |
125 | 125 | { |
126 | - $getter = "get" . $getterName; |
|
126 | + $getter = "get".$getterName; |
|
127 | 127 | |
128 | 128 | $this->target->$getter(); |
129 | 129 | } |
@@ -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 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $this->authMock = $this->getMockBuilder('\Auth\AuthenticationService')->disableOriginalConstructor()->getMock(); |
50 | 50 | $this->organizationRepositoryMock = $this->getMockBuilder('Organizations\Repository\Organization') |
51 | - ->disableOriginalConstructor()->getMock(); |
|
51 | + ->disableOriginalConstructor()->getMock(); |
|
52 | 52 | $this->userRepositoryMock = $this->getMockBuilder('\Auth\Repository\User')->disableOriginalConstructor()->getMock(); |
53 | 53 | |
54 | 54 | if (false !== strpos($this->getName(false), 'Setter')) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $employee->expects($this->once())->method('setStatus')->with(Employee::STATUS_ASSIGNED); |
78 | 78 | |
79 | 79 | $this->organizationMock->expects($this->once())->method('getEmployee')->with($this->userMock->getId()) |
80 | - ->willReturn($employee); |
|
80 | + ->willReturn($employee); |
|
81 | 81 | |
82 | 82 | $this->organizationMock->expects($this->any())->method('getId')->willReturn('testOrgId'); |
83 | 83 | $this->userRepositoryMock->expects($this->once())->method('findByToken')->with('testToken')->willReturn($this->userMock); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | ->willReturn($unassignedEmp); |
105 | 105 | |
106 | 106 | $this->organizationRepositoryMock->expects($this->once()) |
107 | - ->method('findPendingOrganizationsByEmployee') |
|
108 | - ->with($this->userMock->getId()) |
|
109 | - ->willReturn(array($sameOrganization, $assignedEmpOrganization, $unassignedEmpOrganization)); |
|
107 | + ->method('findPendingOrganizationsByEmployee') |
|
108 | + ->with($this->userMock->getId()) |
|
109 | + ->willReturn(array($sameOrganization, $assignedEmpOrganization, $unassignedEmpOrganization)); |
|
110 | 110 | |
111 | 111 | $storageMock = $this->getMockForAbstractClass('\Laminas\Authentication\Storage\StorageInterface'); |
112 | 112 | $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 |
@@ -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 |
@@ -74,8 +74,8 @@ |
||
74 | 74 | $this->target->setPluginManager($plugins); |
75 | 75 | |
76 | 76 | $params = $this->getMockBuilder('\Laminas\Mvc\Controller\Plugin\Params') |
77 | - ->disableOriginalConstructor() |
|
78 | - ->getMock() |
|
77 | + ->disableOriginalConstructor() |
|
78 | + ->getMock() |
|
79 | 79 | ; |
80 | 80 | $params |
81 | 81 | ->expects($this->any()) |
@@ -79,7 +79,7 @@ |
||
79 | 79 | $rep = $this->getMockBuilder('\Organizations\Repository\Organization')->disableOriginalConstructor()->getMock(); |
80 | 80 | |
81 | 81 | $dm->expects($this->once())->method('getRepository')->with('Organizations\Entity\Organization') |
82 | - ->willReturn($rep); |
|
82 | + ->willReturn($rep); |
|
83 | 83 | |
84 | 84 | $doc->setId('test1234'); |
85 | 85 |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | public function testOrganizationReferenceImplementsInterfaces() |
42 | 42 | { |
43 | 43 | $target = $this->getMockBuilder('\Organizations\Entity\OrganizationReference') |
44 | - ->disableOriginalConstructor() |
|
45 | - ->getMock(); |
|
44 | + ->disableOriginalConstructor() |
|
45 | + ->getMock(); |
|
46 | 46 | |
47 | 47 | $this->assertInstanceOf('\Organizations\Entity\OrganizationReferenceInterface', $target); |
48 | 48 | $this->assertInstanceOf('\Organizations\Entity\OrganizationInterface', $target); |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | $organization = new Organization(); |
60 | 60 | |
61 | 61 | $repository = $this->getMockBuilder('\Organizations\Repository\Organization') |
62 | - ->disableOriginalConstructor()->getMock(); |
|
62 | + ->disableOriginalConstructor()->getMock(); |
|
63 | 63 | |
64 | 64 | $repository->expects($this->once()) |
65 | - ->method('findByUser') |
|
66 | - ->with('1234') |
|
67 | - ->willReturn('owner' == $type ? $organization : null); |
|
65 | + ->method('findByUser') |
|
66 | + ->with('1234') |
|
67 | + ->willReturn('owner' == $type ? $organization : null); |
|
68 | 68 | |
69 | 69 | if ('owner' == $type) { |
70 | 70 | $repository->expects($this->never()) |
71 | - ->method('findByEmployee'); |
|
71 | + ->method('findByEmployee'); |
|
72 | 72 | } else { |
73 | 73 | $repository->expects($this->once()) |
74 | - ->method('findByEmployee') |
|
75 | - ->with('1234') |
|
76 | - ->willReturn('employee' == $type ? $organization : null); |
|
74 | + ->method('findByEmployee') |
|
75 | + ->with('1234') |
|
76 | + ->willReturn('employee' == $type ? $organization : null); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $target = new OrganizationReference('1234', $repository); |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | [['setEmployees', 'getEmployees'], [[$emps], []], ['__self__', $emps]], |
197 | 197 | ['getEmployee', ['4321'], null], |
198 | 198 | [['setUser', 'getUser', 'getPermissionsUserIds'], |
199 | - [[$user], [], []], |
|
200 | - ['__self__', $user, [PermissionsInterface::PERMISSION_ALL => [$user->getId()]]] |
|
199 | + [[$user], [], []], |
|
200 | + ['__self__', $user, [PermissionsInterface::PERMISSION_ALL => [$user->getId()]]] |
|
201 | 201 | ], |
202 | 202 | ['getJobs', [], null], |
203 | 203 | [['setPermissions', 'getPermissions'], [[$perms], []], ['__self__', $perms]], |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $args = array($args); |
116 | 116 | } |
117 | 117 | |
118 | - for ($i=0,$c=count($func); $i<$c; $i+=1) { |
|
118 | + for ($i = 0, $c = count($func); $i < $c; $i += 1) { |
|
119 | 119 | $f = $func[$i]; |
120 | 120 | $a = $args[$i]; |
121 | 121 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $expected = array($expected); |
145 | 145 | } |
146 | 146 | |
147 | - for ($i=0, $c=count($func); $i<$c; $i+=1) { |
|
147 | + for ($i = 0, $c = count($func); $i < $c; $i += 1) { |
|
148 | 148 | $f = $func[$i]; |
149 | 149 | $a = $args[$i]; |
150 | 150 | $e = $expected[$i]; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $perms = new Permissions(); |
177 | 177 | $contact = new OrganizationContact(); |
178 | 178 | $image = new OrganizationImage(); |
179 | - $externalId='myReference'; |
|
179 | + $externalId = 'myReference'; |
|
180 | 180 | $template = new Template(); |
181 | 181 | $template->setLabelBenefits('These are your Benefits'); |
182 | 182 | $workflowSettings = new WorkflowSettings(); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | $id = 'someId'; |
156 | 156 | $ext = 'ext'; |
157 | - $name = 'filename.' . $ext; |
|
157 | + $name = 'filename.'.$ext; |
|
158 | 158 | $path = sprintf('d/I/%s.%s', $id, $ext); |
159 | 159 | $resource = 'someResource'; |
160 | 160 | $image = $this->getMockBuilder(ImageEntity::class) |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function testMatchUri($uri, $expected) |
185 | 185 | { |
186 | - $this->assertSame($expected, $this->manager->matchUri($this->options->getUriPath() . $uri)); |
|
186 | + $this->assertSame($expected, $this->manager->matchUri($this->options->getUriPath().$uri)); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -154,7 +154,7 @@ |
||
154 | 154 | { |
155 | 155 | $baseUrl = '/base'; |
156 | 156 | $path = '/some/uri'; |
157 | - $uri = $baseUrl . $path; |
|
157 | + $uri = $baseUrl.$path; |
|
158 | 158 | $this->event->setError(Application::ERROR_ROUTER_NO_MATCH); |
159 | 159 | |
160 | 160 | $this->request->expects($this->once()) |