@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$testConfig = include __DIR__ . '/TestConfig.php'; |
|
3 | +$testConfig = include __DIR__.'/TestConfig.php'; |
|
4 | 4 | |
5 | -require_once __DIR__ . '/../../../test/Bootstrap.php'; |
|
5 | +require_once __DIR__.'/../../../test/Bootstrap.php'; |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | $manager = $target->__invoke($services, AssertionManager::class); |
66 | 66 | |
67 | - $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return ' . ($testResult ? 'TRUE' : 'FALSE') . ' on ' .$testName); |
|
67 | + $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return '.($testResult ? 'TRUE' : 'FALSE').' on '.$testName); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function provideConfigArrays() |
@@ -156,7 +156,7 @@ |
||
156 | 156 | $self = $this; |
157 | 157 | |
158 | 158 | $events->expects($this->once())->method('triggerUntil') |
159 | - ->will($this->returnCallback(function ($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
159 | + ->will($this->returnCallback(function($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
160 | 160 | $self->assertTrue(is_callable($callback)); |
161 | 161 | $self->assertEquals('assert', $eventName); |
162 | 162 | $self->assertSame($acl, $event->getAcl()); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | private $target = [ |
46 | 46 | UserSwitcher::class, |
47 | 47 | 'getSimpleAuthMock', |
48 | - '@testInheritance' => [ 'as_reflection' => true ], |
|
48 | + '@testInheritance' => ['as_reflection' => true], |
|
49 | 49 | '@testInvokationProxiesToCorrectMethods' => [ |
50 | 50 | 'args' => false, |
51 | - 'mock' => [ 'clear' => 1, 'switchUser' => ['with' => 'testUserId', 'count' => 1]], |
|
51 | + 'mock' => ['clear' => 1, 'switchUser' => ['with' => 'testUserId', 'count' => 1]], |
|
52 | 52 | ], |
53 | 53 | '@testClearRestoresOriginalUserAndClearsSession' => [ |
54 | 54 | 'args' => 'getComplexAuthMock', |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | ], |
65 | 65 | ]; |
66 | 66 | |
67 | - private $inheritance = [ AbstractPlugin::class ]; |
|
67 | + private $inheritance = [AbstractPlugin::class]; |
|
68 | 68 | |
69 | 69 | public function propertiesProvider() |
70 | 70 | { |
71 | - $createSession = function () { |
|
71 | + $createSession = function() { |
|
72 | 72 | $_SESSION[UserSwitcher::SESSION_NAMESPACE]['params'] = ['param' => 'value']; |
73 | 73 | }; |
74 | - $clearSession = function () { |
|
74 | + $clearSession = function() { |
|
75 | 75 | $_SESSION = []; |
76 | 76 | }; |
77 | 77 | return [ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ->disableOriginalConstructor() |
114 | 114 | ->getMock(); |
115 | 115 | |
116 | - return [ $auth ]; |
|
116 | + return [$auth]; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | private function getComplexAuthMock() |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $auth->expects($this->any())->method('getUser')->willReturn(new User()); |
140 | 140 | |
141 | - return [ $auth ]; |
|
141 | + return [$auth]; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | public function testInvokationProxiesToCorrectMethods() |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function returnReferenceProvider() |
156 | 156 | { |
157 | 157 | return [ |
158 | - [ null ], [ 'some/ref/uri' ], |
|
158 | + [null], ['some/ref/uri'], |
|
159 | 159 | ]; |
160 | 160 | } |
161 | 161 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $session = new Container(UserSwitcher::SESSION_NAMESPACE); |
170 | 170 | $session->isSwitchedUser = true; |
171 | 171 | $session->originalUser = 'switchedUser'; |
172 | - $oldSession = [ |
|
172 | + $oldSession = [ |
|
173 | 173 | 'oldSession' => true, |
174 | 174 | 'must' => 'be same' |
175 | 175 | ]; |
@@ -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 |
@@ -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', |
@@ -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); |