@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | $acl = new Acl(); |
87 | 87 | |
88 | 88 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
89 | - ->disableOriginalConstructor() |
|
90 | - ->getMock(); |
|
89 | + ->disableOriginalConstructor() |
|
90 | + ->getMock(); |
|
91 | 91 | |
92 | 92 | $events->expects($this->once()) |
93 | - ->method('triggerUntil') |
|
94 | - ->willReturn(new ResponseCollection()); |
|
93 | + ->method('triggerUntil') |
|
94 | + ->willReturn(new ResponseCollection()); |
|
95 | 95 | |
96 | 96 | $target->setEventManager($events); |
97 | 97 | |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | $responseFalse = $this->createResponseMock(false); |
114 | 114 | |
115 | 115 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
116 | - ->disableOriginalConstructor() |
|
117 | - ->getMock(); |
|
116 | + ->disableOriginalConstructor() |
|
117 | + ->getMock(); |
|
118 | 118 | |
119 | 119 | $events->expects($this->exactly(5)) |
120 | - ->method('triggerUntil') |
|
121 | - ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse)); |
|
120 | + ->method('triggerUntil') |
|
121 | + ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse)); |
|
122 | 122 | |
123 | 123 | $target->setEventManager($events); |
124 | 124 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | protected function createResponseMock($returnValue) |
135 | 135 | { |
136 | 136 | $response = $this->getMockBuilder('\Zend\EventManager\ResponseCollection') |
137 | - ->disableOriginalConstructor() |
|
138 | - ->getMock(); |
|
137 | + ->disableOriginalConstructor() |
|
138 | + ->getMock(); |
|
139 | 139 | $response->method('last')->willReturn($returnValue); |
140 | 140 | |
141 | 141 | return $response; |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $target = new TargetMock(); |
147 | 147 | |
148 | 148 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
149 | - ->disableOriginalConstructor() |
|
150 | - ->getMock(); |
|
149 | + ->disableOriginalConstructor() |
|
150 | + ->getMock(); |
|
151 | 151 | |
152 | 152 | $acl = new Acl(); |
153 | 153 | $role = new GenericRole('testRole'); |
@@ -156,16 +156,16 @@ discard block |
||
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) { |
|
160 | - $self->assertTrue(is_callable($callback)); |
|
161 | - $self->assertEquals('assert', $eventName); |
|
162 | - $self->assertSame($acl, $event->getAcl()); |
|
163 | - $self->assertSame($role, $event->getRole()); |
|
164 | - $self->assertSame($resource, $event->getResource()); |
|
165 | - $self->assertSame($privilege, $event->getPrivilege()); |
|
166 | - |
|
167 | - return new ResponseCollection(); |
|
168 | - })); |
|
159 | + ->will($this->returnCallback(function ($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
160 | + $self->assertTrue(is_callable($callback)); |
|
161 | + $self->assertEquals('assert', $eventName); |
|
162 | + $self->assertSame($acl, $event->getAcl()); |
|
163 | + $self->assertSame($role, $event->getRole()); |
|
164 | + $self->assertSame($resource, $event->getResource()); |
|
165 | + $self->assertSame($privilege, $event->getPrivilege()); |
|
166 | + |
|
167 | + return new ResponseCollection(); |
|
168 | + })); |
|
169 | 169 | |
170 | 170 | $target->setEventManager($events); |
171 | 171 | $target->assert($acl, $role, $resource, $privilege); |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | $this->assertTrue($this->target->switchUser('switchedUser')); |
212 | 212 | $this->assertEquals( |
213 | 213 | [ |
214 | - 'isSwitchedUser' => true, |
|
215 | - 'originalUser' => 'originalUser', |
|
216 | - 'params' => [], 'ref' => '/some/ref', |
|
217 | - 'session' => serialize($oldSession) |
|
218 | - ], |
|
214 | + 'isSwitchedUser' => true, |
|
215 | + 'originalUser' => 'originalUser', |
|
216 | + 'params' => [], 'ref' => '/some/ref', |
|
217 | + 'session' => serialize($oldSession) |
|
218 | + ], |
|
219 | 219 | $_SESSION[UserSwitcher::SESSION_NAMESPACE]->getArrayCopy() |
220 | 220 | ); |
221 | 221 | $_SESSION = []; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $acl->expects($this->once())->method('setUser')->with($this->isInstanceOf(User::class)); |
241 | 241 | |
242 | 242 | $user = $this->getMockBuilder(User::class)->disableOriginalConstructor() |
243 | - ->setMethods(['getId'])->getMock(); |
|
243 | + ->setMethods(['getId'])->getMock(); |
|
244 | 244 | $user->expects($this->any())->method('getId')->willReturn('switchedUser'); |
245 | 245 | |
246 | 246 | $this->target->switchUser($user, ['ref' => 'ref']); |
@@ -19,7 +19,6 @@ |
||
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Class ManageControllerTest |
22 | - |
|
23 | 22 | * @package AuthTest\Controller |
24 | 23 | */ |
25 | 24 | class ManageControllerTest extends AbstractFunctionalControllerTestCase |
@@ -45,22 +45,22 @@ |
||
45 | 45 | |
46 | 46 | |
47 | 47 | $callback = $this->getMockBuilder('\Zend\Stdlib\CallbackHandler') |
48 | - ->disableOriginalConstructor() |
|
49 | - ->getMock(); |
|
48 | + ->disableOriginalConstructor() |
|
49 | + ->getMock(); |
|
50 | 50 | |
51 | 51 | $events = $this->getMockBuilder('\Zend\EventManager\SharedEventManagerInterface') |
52 | - ->setMethods(array('attach')) |
|
53 | - ->getMockForAbstractClass(); |
|
52 | + ->setMethods(array('attach')) |
|
53 | + ->getMockForAbstractClass(); |
|
54 | 54 | |
55 | 55 | $events->expects($this->once()) |
56 | - ->method('attach') |
|
57 | - ->with($expId, $expEvent, $expCallback, $expPriority) |
|
58 | - ->willReturn($expCallback); |
|
56 | + ->method('attach') |
|
57 | + ->with($expId, $expEvent, $expCallback, $expPriority) |
|
58 | + ->willReturn($expCallback); |
|
59 | 59 | |
60 | 60 | $events->expects($this->once()) |
61 | - ->method('detach') |
|
62 | - ->with($expCallback, 'Zend\Mvc\Application') |
|
63 | - ->willReturn(true); |
|
61 | + ->method('detach') |
|
62 | + ->with($expCallback, 'Zend\Mvc\Application') |
|
63 | + ->willReturn(true); |
|
64 | 64 | |
65 | 65 | |
66 | 66 | $target->attachShared($events); |
@@ -129,7 +129,7 @@ |
||
129 | 129 | [$this->equalTo(MvcEvent::EVENT_DISPATCH_ERROR), $this->identicalTo([$this->listener, 'prepareExceptionViewModel'], $this->identicalTo(null))], |
130 | 130 | [$this->equalTo(MvcEvent::EVENT_RENDER_ERROR), $this->identicalTo([$this->listener, 'prepareExceptionViewModel'], $this->identicalTo(null))], |
131 | 131 | [$this->equalTo(MvcEvent::EVENT_ROUTE), $this->identicalTo([$this->listener, 'checkDeactivatedUser'], $this->identicalTo(null))] |
132 | - ); |
|
132 | + ); |
|
133 | 133 | |
134 | 134 | $this->listener->attach($eventManager); |
135 | 135 | } |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | use PHPUnit\Framework\TestCase; |
9 | 9 | 'modules' => array_merge($commonModules,array( |
10 | 10 | 'Core', |
11 | - 'Auth', |
|
12 | - 'Jobs', |
|
13 | - 'Organizations', |
|
11 | + 'Auth', |
|
12 | + 'Jobs', |
|
13 | + 'Organizations', |
|
14 | 14 | )), |
15 | 15 | |
16 | 16 | // These are various options for the listeners attached to the ModuleManager |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | // ), |
69 | 69 | // ) |
70 | 70 | |
71 | - // Initial configuration with which to seed the ServiceManager. |
|
72 | - // Should be compatible with Zend\ServiceManager\Config. |
|
73 | - // 'service_manager' => array(), |
|
71 | + // Initial configuration with which to seed the ServiceManager. |
|
72 | + // Should be compatible with Zend\ServiceManager\Config. |
|
73 | + // 'service_manager' => array(), |
|
74 | 74 | ); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | // ), |
61 | 61 | // ) |
62 | 62 | |
63 | - // Initial configuration with which to seed the ServiceManager. |
|
64 | - // Should be compatible with Zend\ServiceManager\Config. |
|
65 | - // 'service_manager' => array(), |
|
63 | + // Initial configuration with which to seed the ServiceManager. |
|
64 | + // Should be compatible with Zend\ServiceManager\Config. |
|
65 | + // 'service_manager' => array(), |
|
66 | 66 | ); |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | $this->pluginMock = $pluginMock; |
48 | 48 | |
49 | 49 | $controller = $this->getMockBuilder('\Zend\Mvc\Controller\AbstractController') |
50 | - ->setMethods(['getRequest', 'plugin']) |
|
51 | - ->getMockForAbstractClass(); |
|
50 | + ->setMethods(['getRequest', 'plugin']) |
|
51 | + ->getMockForAbstractClass(); |
|
52 | 52 | |
53 | 53 | $controller->expects($this->any())->method('getRequest')->willReturn($this->request); |
54 | 54 | $controller->expects($this->any())->method('plugin')->will($this->returnValueMap( |
55 | 55 | [ |
56 | - ['paginator', null, $pluginMock], |
|
57 | - ['paginationParams', null, $pluginMock], |
|
58 | - ['searchform', null, $pluginMock], |
|
59 | - ] |
|
60 | - )); |
|
56 | + ['paginator', null, $pluginMock], |
|
57 | + ['paginationParams', null, $pluginMock], |
|
58 | + ['searchform', null, $pluginMock], |
|
59 | + ] |
|
60 | + )); |
|
61 | 61 | |
62 | 62 | $this->target->setController($controller); |
63 | 63 | } |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | |
118 | 118 | $this->assertAttributeEquals( |
119 | 119 | new Parameters([ |
120 | - 'a' => 'test', 'b' => ['test1', 'test2'], |
|
121 | - 'c' => ['test1', 'test2'], |
|
122 | - 'd' => ['test1' => 1, 'test2' => 1] |
|
123 | - ]), |
|
120 | + 'a' => 'test', 'b' => ['test1', 'test2'], |
|
121 | + 'c' => ['test1', 'test2'], |
|
122 | + 'd' => ['test1' => 1, 'test2' => 1] |
|
123 | + ]), |
|
124 | 124 | 'parameters', |
125 | 125 | $this->target |
126 | 126 | ); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | ->getMock() |
99 | 99 | ; |
100 | 100 | $container = $this->getMockBuilder(ContainerInterface::class) |
101 | - ->getMock(); |
|
101 | + ->getMock(); |
|
102 | 102 | $container->expects($this->once()) |
103 | 103 | ->method('get') |
104 | 104 | ->with('ServiceManager') |