@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | '@testCreateService' => ['mock' => ['__invoke' => ['@with' => 'getCreateServiceInvokationArgs', 'count' => 1]]], |
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 40 | + private $inheritance = [FactoryInterface::class]; |
|
| 41 | 41 | |
| 42 | 42 | private function getCreateServiceInvokationArgs() |
| 43 | 43 | { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | 59 | $container = $this->getServiceManagerMock(); |
| 60 | - $container->setService('repositories',$repositories); |
|
| 60 | + $container->setService('repositories', $repositories); |
|
| 61 | 61 | $container->setService('Config', $config); |
| 62 | 62 | |
| 63 | 63 | $listener = $this->target->__invoke($container, 'irrelevant'); |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | public function testCanCreateService($serviceName, $expected) |
| 61 | 61 | { |
| 62 | 62 | $sm = $this->getMockBuilder(AbstractPluginManager::class) |
| 63 | - ->disableOriginalConstructor() |
|
| 64 | - ->getMock() |
|
| 63 | + ->disableOriginalConstructor() |
|
| 64 | + ->getMock() |
|
| 65 | 65 | ; |
| 66 | 66 | $method = "assert" . ($expected ? 'True' : 'False'); |
| 67 | 67 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $qb->expects($this->once())->method('getQuery')->willReturn($q); |
| 99 | 99 | |
| 100 | 100 | $repositories = $this->getMockBuilder('\Core\Repository\RepositoryService') |
| 101 | - ->disableOriginalConstructor()->getMock(); |
|
| 101 | + ->disableOriginalConstructor()->getMock(); |
|
| 102 | 102 | |
| 103 | 103 | $repositories->expects($this->once())->method('createQueryBuilder')->willReturn($qb); |
| 104 | 104 | |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
| 119 | 119 | |
| 120 | 120 | $sm->expects($this->exactly(2))->method('get') |
| 121 | - ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 122 | - ->will($this->onConsecutiveCalls($repositories, $filters)); |
|
| 121 | + ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 122 | + ->will($this->onConsecutiveCalls($repositories, $filters)); |
|
| 123 | 123 | |
| 124 | 124 | $target = $this->target; |
| 125 | 125 | $paginator = $target($sm,$serviceName, $options); |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | public function serviceNamesProvider() |
| 43 | 43 | { |
| 44 | 44 | return [ |
| 45 | - [ 'Repository/Core/FileEntity', true ], |
|
| 46 | - [ 'Core/FileEntity', true ], |
|
| 47 | - [ 'Repository/NoModuleWillBeEverCalledThat/SomeEntity', false ], |
|
| 48 | - [ 'ThisIsAHighlyUnCommonModuleName/ObscureEntity', false ], |
|
| 45 | + ['Repository/Core/FileEntity', true], |
|
| 46 | + ['Core/FileEntity', true], |
|
| 47 | + ['Repository/NoModuleWillBeEverCalledThat/SomeEntity', false], |
|
| 48 | + ['ThisIsAHighlyUnCommonModuleName/ObscureEntity', false], |
|
| 49 | 49 | ]; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ->disableOriginalConstructor() |
| 64 | 64 | ->getMock() |
| 65 | 65 | ; |
| 66 | - $method = "assert" . ($expected ? 'True' : 'False'); |
|
| 66 | + $method = "assert".($expected ? 'True' : 'False'); |
|
| 67 | 67 | |
| 68 | 68 | $this->{$method}($this->target->canCreate($sm, $serviceName)); |
| 69 | 69 | } |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | public function servicesProvider() |
| 72 | 72 | { |
| 73 | 73 | return [ |
| 74 | - [ 'Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false ], |
|
| 75 | - [ 'Core/TestEntity', '\Core\Entity\TestEntity', [ 'testOption' => 'testValue' ], true ] |
|
| 74 | + ['Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false], |
|
| 75 | + ['Core/TestEntity', '\Core\Entity\TestEntity', ['testOption' => 'testValue'], true] |
|
| 76 | 76 | ]; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -106,23 +106,23 @@ discard block |
||
| 106 | 106 | ->disableOriginalConstructor() |
| 107 | 107 | ->setMethods(['has', 'get'])->getMockForAbstractClass(); |
| 108 | 108 | |
| 109 | - $filters->expects($this->once())->method('has')->with('PaginationQuery/' . $serviceName)->willReturn($hasFilter); |
|
| 109 | + $filters->expects($this->once())->method('has')->with('PaginationQuery/'.$serviceName)->willReturn($hasFilter); |
|
| 110 | 110 | |
| 111 | 111 | if ($hasFilter) { |
| 112 | 112 | $filter = $this->getMockBuilder('\Zend\Filter\FilterInterface')->getMockForAbstractClass(); |
| 113 | 113 | $filter->expects($this->once())->method('filter')->with($options, $qb)->willReturn($qb); |
| 114 | 114 | |
| 115 | - $filters->expects($this->once())->method('get')->with('PaginationQuery/' . $serviceName)->willReturn($filter); |
|
| 115 | + $filters->expects($this->once())->method('get')->with('PaginationQuery/'.$serviceName)->willReturn($filter); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
| 119 | 119 | |
| 120 | 120 | $sm->expects($this->exactly(2))->method('get') |
| 121 | - ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 121 | + ->withConsecutive(['repositories'], ['FilterManager']) |
|
| 122 | 122 | ->will($this->onConsecutiveCalls($repositories, $filters)); |
| 123 | 123 | |
| 124 | 124 | $target = $this->target; |
| 125 | - $paginator = $target($sm,$serviceName, $options); |
|
| 125 | + $paginator = $target($sm, $serviceName, $options); |
|
| 126 | 126 | |
| 127 | 127 | $this->assertInstanceOf('\Zend\Paginator\Paginator', $paginator, 'No Paginator returned.'); |
| 128 | 128 | $adapter = $paginator->getAdapter(); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | private $target = DefaultNavigationFactory::class; |
| 35 | 35 | |
| 36 | - private $inheritance = [ '\Zend\Navigation\Service\DefaultNavigationFactory' ]; |
|
| 36 | + private $inheritance = ['\Zend\Navigation\Service\DefaultNavigationFactory']; |
|
| 37 | 37 | |
| 38 | 38 | public function testSetsActiveFlagOnPagesProvidingTheActiveOnOption() |
| 39 | 39 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'active_on' => 'notMatchedRoute', |
| 46 | 46 | ], |
| 47 | 47 | 'page3' => [ |
| 48 | - 'active_on' => [ 'matchedRouteName', 'anotherRoute' ], |
|
| 48 | + 'active_on' => ['matchedRouteName', 'anotherRoute'], |
|
| 49 | 49 | ], |
| 50 | 50 | 'page4' => [] |
| 51 | 51 | ]; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'active_on' => 'notMatchedRoute', |
| 76 | 76 | ], |
| 77 | 77 | 'page3' => [ |
| 78 | - 'active_on' => [ 'matchedRouteName', 'anotherRoute' ], |
|
| 78 | + 'active_on' => ['matchedRouteName', 'anotherRoute'], |
|
| 79 | 79 | ], |
| 80 | 80 | 'page4' => [] |
| 81 | 81 | ]; |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | public function setUp() |
| 46 | 46 | { |
| 47 | 47 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 48 | - ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 49 | - ->getMock(); |
|
| 48 | + ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 49 | + ->getMock(); |
|
| 50 | 50 | |
| 51 | 51 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
| 52 | - ->disableOriginalConstructor() |
|
| 53 | - ->setMethods(['attach']) |
|
| 54 | - ->getMock(); |
|
| 52 | + ->disableOriginalConstructor() |
|
| 53 | + ->setMethods(['attach']) |
|
| 54 | + ->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $this->target->expects($this->once())->method('createEventManager')->willReturn($events); |
| 57 | 57 | $this->events = $events; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | protected function getServiceManagerMock($listeners, $expectLazyListeners = false) |
| 68 | 68 | { |
| 69 | 69 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
| 70 | - ->disableOriginalConstructor() |
|
| 71 | - ->getMock(); |
|
| 70 | + ->disableOriginalConstructor() |
|
| 71 | + ->getMock(); |
|
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | $hasMap = [ ]; |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $services->expects($this->atLeast(count($hasMap))) |
| 99 | - ->method('has') |
|
| 100 | - ->will($this->returnValueMap($hasMap)) |
|
| 99 | + ->method('has') |
|
| 100 | + ->will($this->returnValueMap($hasMap)) |
|
| 101 | 101 | ; |
| 102 | 102 | |
| 103 | 103 | $services->expects($this->exactly(count($getMap))) |
| 104 | - ->method('get') |
|
| 105 | - ->will($this->returnValueMap($getMap)) |
|
| 104 | + ->method('get') |
|
| 105 | + ->will($this->returnValueMap($getMap)) |
|
| 106 | 106 | ; |
| 107 | 107 | |
| 108 | 108 | return $services; |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | public function testCreatesListenersInstances() |
| 144 | 144 | { |
| 145 | 145 | $this->setTargetListenerConfig( |
| 146 | - ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event','doSomething',1]] |
|
| 146 | + ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event','doSomething',1]] |
|
| 147 | 147 | ); |
| 148 | 148 | $services = $this->getServiceManagerMock([ |
| 149 | - '\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => false |
|
| 149 | + '\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => false |
|
| 150 | 150 | ]); |
| 151 | 151 | |
| 152 | 152 | $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant'); |
@@ -162,36 +162,36 @@ discard block |
||
| 162 | 162 | $this->target->createServiceWithName($services, 'irr', 'relevant'); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - public function testCallsAttachOnListenerAggregates() |
|
| 166 | - { |
|
| 167 | - $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface') |
|
| 168 | - ->getMockForAbstractClass(); |
|
| 169 | - $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]); |
|
| 165 | + public function testCallsAttachOnListenerAggregates() |
|
| 166 | + { |
|
| 167 | + $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface') |
|
| 168 | + ->getMockForAbstractClass(); |
|
| 169 | + $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]); |
|
| 170 | 170 | |
| 171 | - $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]); |
|
| 172 | - $services = $this->getServiceManagerMock(['TestAggregate' => $aggregateMock, 'TestAggregate2' => $aggregateMock]); |
|
| 171 | + $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]); |
|
| 172 | + $services = $this->getServiceManagerMock(['TestAggregate' => $aggregateMock, 'TestAggregate2' => $aggregateMock]); |
|
| 173 | 173 | |
| 174 | - $this->target->createServiceWithName($services, 'no', 'no'); |
|
| 175 | - } |
|
| 174 | + $this->target->createServiceWithName($services, 'no', 'no'); |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | 177 | public function testAttachsListenerToEventManager() |
| 178 | 178 | { |
| 179 | 179 | $listenerMock = new AttachListenerTestListenerMock(); |
| 180 | 180 | $this->setTargetListenerConfig([ |
| 181 | - 'TestListener1' => ['test-event1','doSomething',1], |
|
| 182 | - 'TestListener2' => ['test-event2','doSomething',2] |
|
| 181 | + 'TestListener1' => ['test-event1','doSomething',1], |
|
| 182 | + 'TestListener2' => ['test-event2','doSomething',2] |
|
| 183 | 183 | ]); |
| 184 | 184 | $services = $this->getServiceManagerMock([ |
| 185 | - 'TestListener1' => $listenerMock, |
|
| 186 | - 'TestListener2' => $listenerMock |
|
| 185 | + 'TestListener1' => $listenerMock, |
|
| 186 | + 'TestListener2' => $listenerMock |
|
| 187 | 187 | ]); |
| 188 | 188 | $this->events |
| 189 | - ->expects($this->exactly(2)) |
|
| 190 | - ->method('attach') |
|
| 191 | - ->withConsecutive( |
|
| 192 | - ['test-event1', [$listenerMock,'doSomething'], 1 ], |
|
| 193 | - ['test-event2', [$listenerMock, 'doSomething'], 2 ] |
|
| 194 | - ) |
|
| 189 | + ->expects($this->exactly(2)) |
|
| 190 | + ->method('attach') |
|
| 191 | + ->withConsecutive( |
|
| 192 | + ['test-event1', [$listenerMock,'doSomething'], 1 ], |
|
| 193 | + ['test-event2', [$listenerMock, 'doSomething'], 2 ] |
|
| 194 | + ) |
|
| 195 | 195 | ; |
| 196 | 196 | |
| 197 | 197 | $this->target->createServiceWithName($services, '', ''); |
@@ -244,17 +244,17 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | $lazyAggregateMock = $this->getLazyAggregateMock(); |
| 246 | 246 | $lazyAggregateMock->expects($this->once()) |
| 247 | - ->method('setListeners') |
|
| 247 | + ->method('setListeners') |
|
| 248 | 248 | ->with($expectedLazyListeners) |
| 249 | 249 | ->willReturnSelf() |
| 250 | 250 | ; |
| 251 | 251 | |
| 252 | 252 | $this->setTargetListenerConfig($listeners); |
| 253 | 253 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 254 | - $expectedCallback = [$listenerMock,'doSomething']; |
|
| 254 | + $expectedCallback = [$listenerMock,'doSomething']; |
|
| 255 | 255 | $this->events->expects($this->exactly(16)) |
| 256 | - ->method('attach') |
|
| 257 | - ->withConsecutive( |
|
| 256 | + ->method('attach') |
|
| 257 | + ->withConsecutive( |
|
| 258 | 258 | [ $expectSingleEvent, $expectedCallback, 1 ], |
| 259 | 259 | [ $expectSingleEvent, $expectedCallback, 1 ], |
| 260 | 260 | [ 'event1', $expectedCallback, 1], |
@@ -264,9 +264,9 @@ discard block |
||
| 264 | 264 | [ 'event2', $expectedCallback, 1], |
| 265 | 265 | [ $expectSingleEvent, $expectedCallback, $priority], |
| 266 | 266 | [ 'event1', $expectedCallback, $priority], |
| 267 | - [ 'event2', $expectedCallback, $priority], |
|
| 267 | + [ 'event2', $expectedCallback, $priority], |
|
| 268 | 268 | [ $expectSingleEvent, $expectedCallback, $priority ], |
| 269 | - [ 'event1', $expectedCallback, $priority ], |
|
| 269 | + [ 'event1', $expectedCallback, $priority ], |
|
| 270 | 270 | [ 'event2', $expectedCallback, $priority ], |
| 271 | 271 | [ $expectSingleEvent, [$listenerMock,$additionalMethod], 1], |
| 272 | 272 | [ 'event1', $expectedCallback, $additionalPriority ], |
@@ -307,51 +307,51 @@ discard block |
||
| 307 | 307 | 'Test17' => [ 'events' => $multiEvent, 'method' => 'multiMethod' ], |
| 308 | 308 | ]; |
| 309 | 309 | |
| 310 | - $servicesCfg = array_fill_keys([ |
|
| 311 | - 'Test01', 'Test02', 'Test03', 'Test04', 'Test05', 'Test06', 'Test07', |
|
| 312 | - 'Test08', 'Test09', 'Test10', 'Test11', 'Test12', 'Test13', 'Test14', |
|
| 313 | - 'Test15', 'Test17', |
|
| 314 | - ], $listenerMock); |
|
| 310 | + $servicesCfg = array_fill_keys([ |
|
| 311 | + 'Test01', 'Test02', 'Test03', 'Test04', 'Test05', 'Test06', 'Test07', |
|
| 312 | + 'Test08', 'Test09', 'Test10', 'Test11', 'Test12', 'Test13', 'Test14', |
|
| 313 | + 'Test15', 'Test17', |
|
| 314 | + ], $listenerMock); |
|
| 315 | 315 | $expectedLazyListeners = [ |
| 316 | 316 | [ 'service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1 ], |
| 317 | 317 | ]; |
| 318 | 318 | |
| 319 | 319 | $lazyAggregateMock = $this->getLazyAggregateMock(); |
| 320 | 320 | $lazyAggregateMock |
| 321 | - ->expects($this->once()) |
|
| 322 | - ->method('setListeners') |
|
| 323 | - ->with($expectedLazyListeners) |
|
| 324 | - ->willReturnSelf() |
|
| 321 | + ->expects($this->once()) |
|
| 322 | + ->method('setListeners') |
|
| 323 | + ->with($expectedLazyListeners) |
|
| 324 | + ->willReturnSelf() |
|
| 325 | 325 | ; |
| 326 | 326 | |
| 327 | 327 | $this->setTargetListenerConfig($listeners); |
| 328 | 328 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 329 | 329 | |
| 330 | 330 | $callback1 = [$listenerMock,'doSomething']; |
| 331 | - $callback2 = [$listenerMock,'doSomethingElse']; |
|
| 331 | + $callback2 = [$listenerMock,'doSomethingElse']; |
|
| 332 | 332 | $this->events |
| 333 | - ->expects($this->exactly(20)) |
|
| 334 | - ->method('attach') |
|
| 335 | - ->withConsecutive( |
|
| 336 | - [ $singleEvent[0], $callback1, 1 ], |
|
| 337 | - [ 'prioEvent', $callback1, 10 ], |
|
| 338 | - [ 'methodEvent', $callback1, 1], |
|
| 339 | - [ $singleEvent[0], $callback1, 12], |
|
| 340 | - [ 'prioEvent', $callback1, 10], |
|
| 341 | - [ 'methodEvent', $callback1, 12], |
|
| 342 | - [ $singleEvent[0], $callback1, 1], |
|
| 343 | - [ 'prioEvent' , $callback1, 10], |
|
| 344 | - [ 'methodEvent', $callback1, 1], |
|
| 345 | - [ $singleEvent[0], $callback1, 12], |
|
| 346 | - [ 'prioEvent', $callback2, 10], |
|
| 347 | - [ 'methodEvent', $callback1, 12], |
|
| 348 | - [ 'single', $callback1, 1 ], |
|
| 333 | + ->expects($this->exactly(20)) |
|
| 334 | + ->method('attach') |
|
| 335 | + ->withConsecutive( |
|
| 336 | + [ $singleEvent[0], $callback1, 1 ], |
|
| 337 | + [ 'prioEvent', $callback1, 10 ], |
|
| 338 | + [ 'methodEvent', $callback1, 1], |
|
| 339 | + [ $singleEvent[0], $callback1, 12], |
|
| 340 | + [ 'prioEvent', $callback1, 10], |
|
| 341 | + [ 'methodEvent', $callback1, 12], |
|
| 342 | + [ $singleEvent[0], $callback1, 1], |
|
| 343 | + [ 'prioEvent' , $callback1, 10], |
|
| 344 | + [ 'methodEvent', $callback1, 1], |
|
| 345 | + [ $singleEvent[0], $callback1, 12], |
|
| 346 | + [ 'prioEvent', $callback2, 10], |
|
| 347 | + [ 'methodEvent', $callback1, 12], |
|
| 348 | + [ 'single', $callback1, 1 ], |
|
| 349 | 349 | [ 'method' , $callback1, 1], |
| 350 | - [ 'priority', $callback1, 10], |
|
| 351 | - //[ [ 'method' ], $callback1, 1], |
|
| 352 | - [ 'verbose', $callback1, 20], |
|
| 353 | - [ 'verbose', $callback1, 30], |
|
| 354 | - [ 'verbose', $callback2, 25], |
|
| 350 | + [ 'priority', $callback1, 10], |
|
| 351 | + //[ [ 'method' ], $callback1, 1], |
|
| 352 | + [ 'verbose', $callback1, 20], |
|
| 353 | + [ 'verbose', $callback1, 30], |
|
| 354 | + [ 'verbose', $callback2, 25], |
|
| 355 | 355 | [ 'multi1', [$listenerMock,'multiMethod'], 1], |
| 356 | 356 | [ 'multi2', [$listenerMock,'multiMethod'], 1] |
| 357 | 357 | ) |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | class AttachListenerTestListenerMock { |
| 366 | - public function doSomething(){} |
|
| 367 | - public function doSomethingElse(){} |
|
| 368 | - public function multiMethod(){} |
|
| 366 | + public function doSomething(){} |
|
| 367 | + public function doSomethingElse(){} |
|
| 368 | + public function multiMethod(){} |
|
| 369 | 369 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function setUp() |
| 46 | 46 | { |
| 47 | 47 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 48 | - ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 48 | + ->setMethods(['createEventManager', 'getConfig']) |
|
| 49 | 49 | ->getMock(); |
| 50 | 50 | |
| 51 | 51 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | protected function setTargetListenerConfig($config) |
| 62 | 62 | { |
| 63 | - $cfg = [ 'listeners' => $config ]; |
|
| 63 | + $cfg = ['listeners' => $config]; |
|
| 64 | 64 | $this->target->expects($this->once())->method('getConfig')->willReturn($cfg); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | ->getMock(); |
| 72 | 72 | |
| 73 | 73 | |
| 74 | - $hasMap = [ ]; |
|
| 75 | - $getMap = [ ]; |
|
| 74 | + $hasMap = []; |
|
| 75 | + $getMap = []; |
|
| 76 | 76 | $defaultListenerMock = new AttachListenerTestListenerMock(); |
| 77 | 77 | |
| 78 | 78 | $lazyAggregateMock = $this->getLazyAggregateMock($expectLazyListeners); |
| 79 | 79 | if ($expectLazyListeners) { |
| 80 | 80 | $lazyAggregateMock->expects($this->once())->method('attach'); |
| 81 | - $getMap[] = [ 'Core/Listener/DeferredListenerAggregate', $lazyAggregateMock ]; |
|
| 81 | + $getMap[] = ['Core/Listener/DeferredListenerAggregate', $lazyAggregateMock]; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | foreach ($listeners as $serviceName => $listenerMock) { |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if (false === $listenerMock) { |
| 91 | - $hasMap[] = [ $serviceName, false]; |
|
| 91 | + $hasMap[] = [$serviceName, false]; |
|
| 92 | 92 | } else { |
| 93 | - $hasMap[] = [ $serviceName, true ]; |
|
| 94 | - $getMap[] = [ $serviceName, $listenerMock ]; |
|
| 93 | + $hasMap[] = [$serviceName, true]; |
|
| 94 | + $getMap[] = [$serviceName, $listenerMock]; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | public function testPullsListenersFromServiceManager() |
| 137 | 137 | { |
| 138 | - $this->setTargetListenerConfig(['TestListener' => ['test-event','doSomething',1]]); |
|
| 138 | + $this->setTargetListenerConfig(['TestListener' => ['test-event', 'doSomething', 1]]); |
|
| 139 | 139 | $services = $this->getServiceManagerMock(['TestListener']); |
| 140 | 140 | $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant'); |
| 141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function testCreatesListenersInstances() |
| 144 | 144 | { |
| 145 | 145 | $this->setTargetListenerConfig( |
| 146 | - ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event','doSomething',1]] |
|
| 146 | + ['\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => ['test-event', 'doSomething', 1]] |
|
| 147 | 147 | ); |
| 148 | 148 | $services = $this->getServiceManagerMock([ |
| 149 | 149 | '\CoreTest\Factory\EventManager\EventManagerAbstractFactory\AttachListenerTestListenerMock' => false |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | { |
| 167 | 167 | $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface') |
| 168 | 168 | ->getMockForAbstractClass(); |
| 169 | - $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]); |
|
| 169 | + $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([$this->events, 1], [$this->events, -100]); |
|
| 170 | 170 | |
| 171 | 171 | $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]); |
| 172 | 172 | $services = $this->getServiceManagerMock(['TestAggregate' => $aggregateMock, 'TestAggregate2' => $aggregateMock]); |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | { |
| 179 | 179 | $listenerMock = new AttachListenerTestListenerMock(); |
| 180 | 180 | $this->setTargetListenerConfig([ |
| 181 | - 'TestListener1' => ['test-event1','doSomething',1], |
|
| 182 | - 'TestListener2' => ['test-event2','doSomething',2] |
|
| 181 | + 'TestListener1' => ['test-event1', 'doSomething', 1], |
|
| 182 | + 'TestListener2' => ['test-event2', 'doSomething', 2] |
|
| 183 | 183 | ]); |
| 184 | 184 | $services = $this->getServiceManagerMock([ |
| 185 | 185 | 'TestListener1' => $listenerMock, |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | ->expects($this->exactly(2)) |
| 190 | 190 | ->method('attach') |
| 191 | 191 | ->withConsecutive( |
| 192 | - ['test-event1', [$listenerMock,'doSomething'], 1 ], |
|
| 193 | - ['test-event2', [$listenerMock, 'doSomething'], 2 ] |
|
| 192 | + ['test-event1', [$listenerMock, 'doSomething'], 1], |
|
| 193 | + ['test-event2', [$listenerMock, 'doSomething'], 2] |
|
| 194 | 194 | ) |
| 195 | 195 | ; |
| 196 | 196 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $listenerMock = new AttachListenerTestListenerMock(); |
| 203 | 203 | $singleEvent = 'event'; |
| 204 | 204 | $expectSingleEvent = $singleEvent; |
| 205 | - $multiEvent = [ 'event1', 'event2' ]; |
|
| 205 | + $multiEvent = ['event1', 'event2']; |
|
| 206 | 206 | $method = 'doSomething'; |
| 207 | 207 | $additionalMethod = 'doSomethingElse'; |
| 208 | 208 | $priority = 1; |
@@ -211,30 +211,30 @@ discard block |
||
| 211 | 211 | $notLazy = false; |
| 212 | 212 | |
| 213 | 213 | $listeners = [ |
| 214 | - 'Test01' => [ $singleEvent, $method], |
|
| 215 | - 'Test02' => [ $singleEvent, $method ], |
|
| 216 | - 'Test03' => [ $multiEvent, $method ], |
|
| 217 | - 'Test04' => [ $singleEvent, $method ], |
|
| 218 | - 'Test05' => [ $multiEvent, $method ], |
|
| 219 | - 'Test06' => [ $singleEvent, $method, $priority ], |
|
| 220 | - 'Test07' => [ $multiEvent, $method, $priority ], |
|
| 221 | - 'Test08' => [ $singleEvent, $method, $priority, $lazy ], |
|
| 222 | - 'Test09' => [ $multiEvent, $method, $priority, $lazy ], |
|
| 223 | - 'Test10' => [ $singleEvent,$method, $priority ], |
|
| 224 | - 'Test11' => [ $multiEvent, $method, $priority ], |
|
| 225 | - 'Test12' => [ $singleEvent,$method, $lazy ], |
|
| 226 | - 'Test13' => [ $multiEvent,$method, $lazy ], |
|
| 227 | - 'Test14' => [ $singleEvent, $method, $additionalMethod ], |
|
| 228 | - 'Test15' => [ $multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority ], |
|
| 214 | + 'Test01' => [$singleEvent, $method], |
|
| 215 | + 'Test02' => [$singleEvent, $method], |
|
| 216 | + 'Test03' => [$multiEvent, $method], |
|
| 217 | + 'Test04' => [$singleEvent, $method], |
|
| 218 | + 'Test05' => [$multiEvent, $method], |
|
| 219 | + 'Test06' => [$singleEvent, $method, $priority], |
|
| 220 | + 'Test07' => [$multiEvent, $method, $priority], |
|
| 221 | + 'Test08' => [$singleEvent, $method, $priority, $lazy], |
|
| 222 | + 'Test09' => [$multiEvent, $method, $priority, $lazy], |
|
| 223 | + 'Test10' => [$singleEvent, $method, $priority], |
|
| 224 | + 'Test11' => [$multiEvent, $method, $priority], |
|
| 225 | + 'Test12' => [$singleEvent, $method, $lazy], |
|
| 226 | + 'Test13' => [$multiEvent, $method, $lazy], |
|
| 227 | + 'Test14' => [$singleEvent, $method, $additionalMethod], |
|
| 228 | + 'Test15' => [$multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority], |
|
| 229 | 229 | ]; |
| 230 | 230 | |
| 231 | 231 | $expectedLazyListeners = [ |
| 232 | - [ 'service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority ], |
|
| 233 | - [ 'service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority ], |
|
| 234 | - [ 'service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority ], |
|
| 235 | - [ 'service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1 ], |
|
| 236 | - [ 'service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1], |
|
| 237 | - [ 'service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1], |
|
| 232 | + ['service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority], |
|
| 233 | + ['service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority], |
|
| 234 | + ['service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority], |
|
| 235 | + ['service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1], |
|
| 236 | + ['service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1], |
|
| 237 | + ['service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1], |
|
| 238 | 238 | ]; |
| 239 | 239 | |
| 240 | 240 | $servicesCfg = array_fill_keys([ |
@@ -251,26 +251,26 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | $this->setTargetListenerConfig($listeners); |
| 253 | 253 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 254 | - $expectedCallback = [$listenerMock,'doSomething']; |
|
| 254 | + $expectedCallback = [$listenerMock, 'doSomething']; |
|
| 255 | 255 | $this->events->expects($this->exactly(16)) |
| 256 | 256 | ->method('attach') |
| 257 | 257 | ->withConsecutive( |
| 258 | - [ $expectSingleEvent, $expectedCallback, 1 ], |
|
| 259 | - [ $expectSingleEvent, $expectedCallback, 1 ], |
|
| 260 | - [ 'event1', $expectedCallback, 1], |
|
| 261 | - [ 'event2', $expectedCallback, 1], |
|
| 262 | - [ $expectSingleEvent, $expectedCallback, 1], |
|
| 263 | - [ 'event1', $expectedCallback, 1], |
|
| 264 | - [ 'event2', $expectedCallback, 1], |
|
| 265 | - [ $expectSingleEvent, $expectedCallback, $priority], |
|
| 266 | - [ 'event1', $expectedCallback, $priority], |
|
| 267 | - [ 'event2', $expectedCallback, $priority], |
|
| 268 | - [ $expectSingleEvent, $expectedCallback, $priority ], |
|
| 269 | - [ 'event1', $expectedCallback, $priority ], |
|
| 270 | - [ 'event2', $expectedCallback, $priority ], |
|
| 271 | - [ $expectSingleEvent, [$listenerMock,$additionalMethod], 1], |
|
| 272 | - [ 'event1', $expectedCallback, $additionalPriority ], |
|
| 273 | - [ 'event2', $expectedCallback, $additionalPriority ] |
|
| 258 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 259 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 260 | + ['event1', $expectedCallback, 1], |
|
| 261 | + ['event2', $expectedCallback, 1], |
|
| 262 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 263 | + ['event1', $expectedCallback, 1], |
|
| 264 | + ['event2', $expectedCallback, 1], |
|
| 265 | + [$expectSingleEvent, $expectedCallback, $priority], |
|
| 266 | + ['event1', $expectedCallback, $priority], |
|
| 267 | + ['event2', $expectedCallback, $priority], |
|
| 268 | + [$expectSingleEvent, $expectedCallback, $priority], |
|
| 269 | + ['event1', $expectedCallback, $priority], |
|
| 270 | + ['event2', $expectedCallback, $priority], |
|
| 271 | + [$expectSingleEvent, [$listenerMock, $additionalMethod], 1], |
|
| 272 | + ['event1', $expectedCallback, $additionalPriority], |
|
| 273 | + ['event2', $expectedCallback, $additionalPriority] |
|
| 274 | 274 | ); |
| 275 | 275 | |
| 276 | 276 | $this->target->createServiceWithName($services, '', ''); |
@@ -279,32 +279,32 @@ discard block |
||
| 279 | 279 | public function testNormalizeListenerOptionsWithArrayHashSpecification() |
| 280 | 280 | { |
| 281 | 281 | $listenerMock = new AttachListenerTestListenerMock(); |
| 282 | - $singleEvent = [ 'singleEvent' ]; |
|
| 283 | - $priorityEvent = [ 'prioEvent' => 10 ]; |
|
| 284 | - $methodEvent = [ 'methodEvent' => 'doSomething' ]; |
|
| 285 | - $singleAndPriorityAndMethodEvent = [ 'single', 'priority' => 10, 'method' => 'doSomething']; |
|
| 286 | - $verboseEvent = [ 'verbose' => [ 'method' => 'doSomething', 'priority' => 20]]; |
|
| 287 | - $verboseFullEvent = [ 'verbose' => [ 'method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]]; |
|
| 288 | - $multiEvent = [ 'multi1', 'multi2' ]; |
|
| 282 | + $singleEvent = ['singleEvent']; |
|
| 283 | + $priorityEvent = ['prioEvent' => 10]; |
|
| 284 | + $methodEvent = ['methodEvent' => 'doSomething']; |
|
| 285 | + $singleAndPriorityAndMethodEvent = ['single', 'priority' => 10, 'method' => 'doSomething']; |
|
| 286 | + $verboseEvent = ['verbose' => ['method' => 'doSomething', 'priority' => 20]]; |
|
| 287 | + $verboseFullEvent = ['verbose' => ['method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]]; |
|
| 288 | + $multiEvent = ['multi1', 'multi2']; |
|
| 289 | 289 | |
| 290 | 290 | $listeners = [ |
| 291 | - 'Test01' => [ 'events' => $singleEvent, 'method' => 'doSomething'], |
|
| 292 | - 'Test02' => [ 'events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 293 | - 'Test03' => [ 'events' => $methodEvent, 'method' => 'doSomething'], |
|
| 294 | - 'Test04' => [ 'events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 295 | - 'Test05' => [ 'events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 296 | - 'Test06' => [ 'events' => $methodEvent,'method'=>'doSomething', 'priority' => 12], |
|
| 297 | - 'Test07' => [ 'events' => $singleEvent, 'method' => 'doSomething'], |
|
| 298 | - 'Test08' => [ 'events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 299 | - 'Test09' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse'], |
|
| 300 | - 'Test10' => [ 'events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12], |
|
| 301 | - 'Test11' => [ 'events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 302 | - 'Test12' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 303 | - 'Test13' => [ 'events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'], |
|
| 304 | - 'Test14' => [ 'events' => $verboseEvent], |
|
| 305 | - 'Test15' => [ 'events' => $verboseFullEvent], |
|
| 306 | - 'Test16' => [ 'events' => $singleEvent, 'lazy' => true], |
|
| 307 | - 'Test17' => [ 'events' => $multiEvent, 'method' => 'multiMethod' ], |
|
| 291 | + 'Test01' => ['events' => $singleEvent, 'method' => 'doSomething'], |
|
| 292 | + 'Test02' => ['events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 293 | + 'Test03' => ['events' => $methodEvent, 'method' => 'doSomething'], |
|
| 294 | + 'Test04' => ['events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 295 | + 'Test05' => ['events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 296 | + 'Test06' => ['events' => $methodEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 297 | + 'Test07' => ['events' => $singleEvent, 'method' => 'doSomething'], |
|
| 298 | + 'Test08' => ['events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 299 | + 'Test09' => ['events' => $methodEvent, 'method' => 'doSomethingElse'], |
|
| 300 | + 'Test10' => ['events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12], |
|
| 301 | + 'Test11' => ['events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 302 | + 'Test12' => ['events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 303 | + 'Test13' => ['events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'], |
|
| 304 | + 'Test14' => ['events' => $verboseEvent], |
|
| 305 | + 'Test15' => ['events' => $verboseFullEvent], |
|
| 306 | + 'Test16' => ['events' => $singleEvent, 'lazy' => true], |
|
| 307 | + 'Test17' => ['events' => $multiEvent, 'method' => 'multiMethod'], |
|
| 308 | 308 | ]; |
| 309 | 309 | |
| 310 | 310 | $servicesCfg = array_fill_keys([ |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | 'Test15', 'Test17', |
| 314 | 314 | ], $listenerMock); |
| 315 | 315 | $expectedLazyListeners = [ |
| 316 | - [ 'service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1 ], |
|
| 316 | + ['service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1], |
|
| 317 | 317 | ]; |
| 318 | 318 | |
| 319 | 319 | $lazyAggregateMock = $this->getLazyAggregateMock(); |
@@ -327,33 +327,33 @@ discard block |
||
| 327 | 327 | $this->setTargetListenerConfig($listeners); |
| 328 | 328 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 329 | 329 | |
| 330 | - $callback1 = [$listenerMock,'doSomething']; |
|
| 331 | - $callback2 = [$listenerMock,'doSomethingElse']; |
|
| 330 | + $callback1 = [$listenerMock, 'doSomething']; |
|
| 331 | + $callback2 = [$listenerMock, 'doSomethingElse']; |
|
| 332 | 332 | $this->events |
| 333 | 333 | ->expects($this->exactly(20)) |
| 334 | 334 | ->method('attach') |
| 335 | 335 | ->withConsecutive( |
| 336 | - [ $singleEvent[0], $callback1, 1 ], |
|
| 337 | - [ 'prioEvent', $callback1, 10 ], |
|
| 338 | - [ 'methodEvent', $callback1, 1], |
|
| 339 | - [ $singleEvent[0], $callback1, 12], |
|
| 340 | - [ 'prioEvent', $callback1, 10], |
|
| 341 | - [ 'methodEvent', $callback1, 12], |
|
| 342 | - [ $singleEvent[0], $callback1, 1], |
|
| 343 | - [ 'prioEvent' , $callback1, 10], |
|
| 344 | - [ 'methodEvent', $callback1, 1], |
|
| 345 | - [ $singleEvent[0], $callback1, 12], |
|
| 346 | - [ 'prioEvent', $callback2, 10], |
|
| 347 | - [ 'methodEvent', $callback1, 12], |
|
| 348 | - [ 'single', $callback1, 1 ], |
|
| 349 | - [ 'method' , $callback1, 1], |
|
| 350 | - [ 'priority', $callback1, 10], |
|
| 336 | + [$singleEvent[0], $callback1, 1], |
|
| 337 | + ['prioEvent', $callback1, 10], |
|
| 338 | + ['methodEvent', $callback1, 1], |
|
| 339 | + [$singleEvent[0], $callback1, 12], |
|
| 340 | + ['prioEvent', $callback1, 10], |
|
| 341 | + ['methodEvent', $callback1, 12], |
|
| 342 | + [$singleEvent[0], $callback1, 1], |
|
| 343 | + ['prioEvent', $callback1, 10], |
|
| 344 | + ['methodEvent', $callback1, 1], |
|
| 345 | + [$singleEvent[0], $callback1, 12], |
|
| 346 | + ['prioEvent', $callback2, 10], |
|
| 347 | + ['methodEvent', $callback1, 12], |
|
| 348 | + ['single', $callback1, 1], |
|
| 349 | + ['method', $callback1, 1], |
|
| 350 | + ['priority', $callback1, 10], |
|
| 351 | 351 | //[ [ 'method' ], $callback1, 1], |
| 352 | - [ 'verbose', $callback1, 20], |
|
| 353 | - [ 'verbose', $callback1, 30], |
|
| 354 | - [ 'verbose', $callback2, 25], |
|
| 355 | - [ 'multi1', [$listenerMock,'multiMethod'], 1], |
|
| 356 | - [ 'multi2', [$listenerMock,'multiMethod'], 1] |
|
| 352 | + ['verbose', $callback1, 20], |
|
| 353 | + ['verbose', $callback1, 30], |
|
| 354 | + ['verbose', $callback2, 25], |
|
| 355 | + ['multi1', [$listenerMock, 'multiMethod'], 1], |
|
| 356 | + ['multi2', [$listenerMock, 'multiMethod'], 1] |
|
| 357 | 357 | ) |
| 358 | 358 | ; |
| 359 | 359 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | class AttachListenerTestListenerMock { |
| 366 | - public function doSomething(){} |
|
| 367 | - public function doSomethingElse(){} |
|
| 368 | - public function multiMethod(){} |
|
| 366 | + public function doSomething() {} |
|
| 367 | + public function doSomethingElse() {} |
|
| 368 | + public function multiMethod() {} |
|
| 369 | 369 | } |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $services = new ServiceManager(); |
| 46 | 46 | $this->assertTrue( |
| 47 | - $this->target->canCreate( |
|
| 47 | + $this->target->canCreate( |
|
| 48 | 48 | $services,'Any.string/Value/Events' |
| 49 | - ), |
|
| 50 | - 'Checking correct name failed.' |
|
| 49 | + ), |
|
| 50 | + 'Checking correct name failed.' |
|
| 51 | 51 | ); |
| 52 | 52 | $this->assertFalse( |
| 53 | - $this->target->canCreate( |
|
| 53 | + $this->target->canCreate( |
|
| 54 | 54 | $services,'Any.string.not.ending/in/Events.but has it in the middle!' |
| 55 | - ), |
|
| 56 | - 'Checking invalid name failed.' |
|
| 55 | + ), |
|
| 56 | + 'Checking invalid name failed.' |
|
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | /* @var EventManagerAbstractFactory|\PHPUnit_Framework_MockObject_MockObject $target */ |
| 96 | 96 | $target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 97 | - ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 98 | - ->getMock(); |
|
| 97 | + ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 98 | + ->getMock(); |
|
| 99 | 99 | |
| 100 | 100 | $services = new ServiceManager(); |
| 101 | 101 | $services->setService('Config', $config); |
@@ -38,20 +38,20 @@ discard block |
||
| 38 | 38 | '@testCanCreateServiceWithName' => ['mock' => ['canCreate' => 1]], |
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | - protected $inheritance = [ '\Zend\ServiceManager\Factory\AbstractFactoryInterface' ]; |
|
| 41 | + protected $inheritance = ['\Zend\ServiceManager\Factory\AbstractFactoryInterface']; |
|
| 42 | 42 | |
| 43 | 43 | public function testDeterminesIfItCanCreateAnEventManagerByName() |
| 44 | 44 | { |
| 45 | 45 | $services = new ServiceManager(); |
| 46 | 46 | $this->assertTrue( |
| 47 | 47 | $this->target->canCreate( |
| 48 | - $services,'Any.string/Value/Events' |
|
| 48 | + $services, 'Any.string/Value/Events' |
|
| 49 | 49 | ), |
| 50 | 50 | 'Checking correct name failed.' |
| 51 | 51 | ); |
| 52 | 52 | $this->assertFalse( |
| 53 | 53 | $this->target->canCreate( |
| 54 | - $services,'Any.string.not.ending/in/Events.but has it in the middle!' |
|
| 54 | + $services, 'Any.string.not.ending/in/Events.but has it in the middle!' |
|
| 55 | 55 | ), |
| 56 | 56 | 'Checking invalid name failed.' |
| 57 | 57 | ); |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | $config1 = []; |
| 63 | 63 | |
| 64 | 64 | $config2 = [ |
| 65 | - 'event_manager' => [ 'Test2/Events' => [ |
|
| 65 | + 'event_manager' => ['Test2/Events' => [ |
|
| 66 | 66 | 'service' => 'TestService', |
| 67 | 67 | 'configure' => false, |
| 68 | - 'identifiers' => [ 'TestEvents', 'AnotherId' ], |
|
| 68 | + 'identifiers' => ['TestEvents', 'AnotherId'], |
|
| 69 | 69 | 'event' => 'SomeEventClass', |
| 70 | - 'listeners' => [ 'listener' => 'event' ] |
|
| 70 | + 'listeners' => ['listener' => 'event'] |
|
| 71 | 71 | ]] |
| 72 | 72 | ]; |
| 73 | 73 | return [ |
| 74 | - [ $config1, 'Test1/Events' ], |
|
| 75 | - [ $config2, 'Test2/Events' ], |
|
| 74 | + [$config1, 'Test1/Events'], |
|
| 75 | + [$config2, 'Test2/Events'], |
|
| 76 | 76 | ]; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | $defaults = [ |
| 88 | 88 | 'service' => 'EventManager', |
| 89 | 89 | 'configure' => true, |
| 90 | - 'identifiers' => [ $reqName ], |
|
| 90 | + 'identifiers' => [$reqName], |
|
| 91 | 91 | 'event' => '\Zend\EventManager\Event', |
| 92 | 92 | 'listeners' => [], |
| 93 | 93 | ]; |
| 94 | 94 | |
| 95 | 95 | /* @var EventManagerAbstractFactory|\PHPUnit_Framework_MockObject_MockObject $target */ |
| 96 | 96 | $target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 97 | - ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 97 | + ->setMethods(['createEventManager', 'attachListeners']) |
|
| 98 | 98 | ->getMock(); |
| 99 | 99 | |
| 100 | 100 | $services = new ServiceManager(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $target->expects($this->once())->method('createEventManager')->with($services, $expected); |
| 110 | 110 | |
| 111 | - $target($services,$reqName); |
|
| 111 | + $target($services, $reqName); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | public function testCanCreateServiceWithName() |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | public function setUp() |
| 40 | 40 | { |
| 41 | 41 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 42 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 43 | - ->getMock(); |
|
| 42 | + ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 43 | + ->getMock(); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | |
@@ -59,17 +59,17 @@ discard block |
||
| 59 | 59 | $config['event'] = '\Zend\EventManager\Event'; |
| 60 | 60 | } |
| 61 | 61 | $this->target |
| 62 | - ->expects($this->once()) |
|
| 63 | - ->method('getConfig') |
|
| 64 | - ->willReturn($config) |
|
| 62 | + ->expects($this->once()) |
|
| 63 | + ->method('getConfig') |
|
| 64 | + ->willReturn($config) |
|
| 65 | 65 | ; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | protected function getServiceManagerMock($events, $args = []) |
| 69 | 69 | { |
| 70 | 70 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
| 71 | - ->disableOriginalConstructor() |
|
| 72 | - ->getMock(); |
|
| 71 | + ->disableOriginalConstructor() |
|
| 72 | + ->getMock(); |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | if (is_Array($events)) { |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | ->method('has')->will($this->returnValueMap($hasMap)); |
| 97 | 97 | */ |
| 98 | 98 | $services->expects($this->any()) |
| 99 | - ->method('has') |
|
| 100 | - ->will($this->returnValueMap($hasMap)) |
|
| 99 | + ->method('has') |
|
| 100 | + ->will($this->returnValueMap($hasMap)) |
|
| 101 | 101 | ; |
| 102 | 102 | $services->expects($this->exactly(count($getMap))) |
| 103 | - ->method('get')->will($this->returnValueMap($getMap)); |
|
| 103 | + ->method('get')->will($this->returnValueMap($getMap)); |
|
| 104 | 104 | |
| 105 | 105 | return $services; |
| 106 | 106 | } |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | public function testThrowsExceptionIfNoEventManagerCanBeCreated() |
| 132 | 132 | { |
| 133 | - $this->expectException(\UnexpectedValueException::class); |
|
| 134 | - $this->expectExceptionMessage('Cannot create'); |
|
| 133 | + $this->expectException(\UnexpectedValueException::class); |
|
| 134 | + $this->expectExceptionMessage('Cannot create'); |
|
| 135 | 135 | |
| 136 | 136 | $this->setTargetConfig(['service' => 'NonExistantClass' ]); |
| 137 | 137 | |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | $events = $this->getMockBuilder('\Core\EventManager\EventManager')->disableOriginalConstructor() |
| 166 | 166 | ->setMethods(['setIdentifiers', 'setEventPrototype'])->getMock(); |
| 167 | 167 | $events |
| 168 | - ->expects($this->once()) |
|
| 169 | - ->method('setEventPrototype') |
|
| 170 | - ->with($event) |
|
| 168 | + ->expects($this->once()) |
|
| 169 | + ->method('setEventPrototype') |
|
| 170 | + ->with($event) |
|
| 171 | 171 | ; |
| 172 | 172 | |
| 173 | 173 | $services = $this->getServiceManagerMock(['EventManager' => $events], [ 'Event' => $event ]); |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $event = new \Zend\EventManager\Event(); |
| 181 | 181 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
| 182 | - ->disableOriginalConstructor() |
|
| 183 | - ->setMethods(['setIdentifiers', 'setEventPrototype']) |
|
| 184 | - ->getMock() |
|
| 182 | + ->disableOriginalConstructor() |
|
| 183 | + ->setMethods(['setIdentifiers', 'setEventPrototype']) |
|
| 184 | + ->getMock() |
|
| 185 | 185 | ; |
| 186 | 186 | $events |
| 187 | - ->expects($this->once()) |
|
| 188 | - ->method('setEventPrototype') |
|
| 189 | - ->with($this->isInstanceOf(Event::class)) |
|
| 187 | + ->expects($this->once()) |
|
| 188 | + ->method('setEventPrototype') |
|
| 189 | + ->with($this->isInstanceOf(Event::class)) |
|
| 190 | 190 | ; |
| 191 | 191 | |
| 192 | 192 | $services = $this->getServiceManagerMock(['EventManager' => $events]); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function setUp() |
| 40 | 40 | { |
| 41 | 41 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 42 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 42 | + ->setMethods(['attachListeners', 'getConfig']) |
|
| 43 | 43 | ->getMock(); |
| 44 | 44 | |
| 45 | 45 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $config['listeners'] = []; |
| 54 | 54 | } |
| 55 | 55 | if (!isset($config['identifiers'])) { |
| 56 | - $config['identifiers'] = [ 'Test/Events/Manager' ]; |
|
| 56 | + $config['identifiers'] = ['Test/Events/Manager']; |
|
| 57 | 57 | } |
| 58 | 58 | if (!isset($config['event'])) { |
| 59 | 59 | $config['event'] = '\Zend\EventManager\Event'; |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | $eventsService = 'Test/Events/Manager'; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - $hasMap = [ [ $eventsService, true ] ]; |
|
| 84 | - $getMap = [ [ $eventsService, $events ] ]; |
|
| 83 | + $hasMap = [[$eventsService, true]]; |
|
| 84 | + $getMap = [[$eventsService, $events]]; |
|
| 85 | 85 | |
| 86 | 86 | foreach ($args as $serviceName => $serviceValue) { |
| 87 | 87 | if (false === $serviceValue) { |
| 88 | - $hasMap[] = [ $serviceName, true ]; |
|
| 88 | + $hasMap[] = [$serviceName, true]; |
|
| 89 | 89 | } else { |
| 90 | - $hasMap[] = [ $serviceName, true]; |
|
| 91 | - $getMap[] = [ $serviceName, $serviceValue ]; |
|
| 90 | + $hasMap[] = [$serviceName, true]; |
|
| 91 | + $getMap[] = [$serviceName, $serviceValue]; |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $services->setService('Test/Events/Manager', $events); |
| 114 | 114 | |
| 115 | - $this->setTargetConfig([ 'service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
| 115 | + $this->setTargetConfig(['service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
| 116 | 116 | |
| 117 | 117 | $this->target->expects($this->once())->method('attachListeners')->with($services, $events, []); |
| 118 | 118 | $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events'); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | public function testInstatiatesEventManagerFromClassName() |
| 122 | 122 | { |
| 123 | - $this->setTargetConfig([ 'service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
| 123 | + $this->setTargetConfig(['service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
| 124 | 124 | |
| 125 | 125 | $services = new ServiceManager(); |
| 126 | 126 | $events = $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant'); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->expectException(\UnexpectedValueException::class); |
| 134 | 134 | $this->expectExceptionMessage('Cannot create'); |
| 135 | 135 | |
| 136 | - $this->setTargetConfig(['service' => 'NonExistantClass' ]); |
|
| 136 | + $this->setTargetConfig(['service' => 'NonExistantClass']); |
|
| 137 | 137 | |
| 138 | 138 | $this->target->createServiceWithName(new ServiceManager(), 'irrelevant', 'irrelevant'); |
| 139 | 139 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | public function testSetsIdentifiersOnEventManagerInstance() |
| 151 | 151 | { |
| 152 | - $ids = [ 'testID', 'TestId2' ]; |
|
| 152 | + $ids = ['testID', 'TestId2']; |
|
| 153 | 153 | $events = new EventManager(); |
| 154 | 154 | $services = $this->getServiceManagerMock(['EventManager' => $events]); |
| 155 | 155 | $this->setTargetConfig(['configure' => true, 'identifiers' => $ids, 'service' => 'EventManager']); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | ->with($event) |
| 171 | 171 | ; |
| 172 | 172 | |
| 173 | - $services = $this->getServiceManagerMock(['EventManager' => $events], [ 'Event' => $event ]); |
|
| 173 | + $services = $this->getServiceManagerMock(['EventManager' => $events], ['Event' => $event]); |
|
| 174 | 174 | $this->setTargetConfig(['configure' => true, 'service' => 'EventManager', 'event' => 'Event']); |
| 175 | 175 | $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events'); |
| 176 | 176 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | protected $target = '\Core\Controller\AdminControllerEvent'; |
| 30 | 30 | |
| 31 | - protected $inheritance = [ '\Zend\EventManager\Event' ]; |
|
| 31 | + protected $inheritance = ['\Zend\EventManager\Event']; |
|
| 32 | 32 | |
| 33 | 33 | public function testCreatesModelPriorityListUponCreation() |
| 34 | 34 | { |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | public function provideAddViewTemplateTestData() |
| 63 | 63 | { |
| 64 | 64 | return [ |
| 65 | - [ [ 'test', 'template' ], ['test', 'template', [], 0] ], |
|
| 66 | - [ [ 'test', 'template', [ 'var' => 'iable']], [ 'test', 'template', [ 'var' => 'iable'], 0] ], |
|
| 67 | - [ [ 'test', 'template', 10] , ['test', 'template', [], 10] ], |
|
| 68 | - [ [ 'test', 'template', [ 'var' => 'iable'], 10 ], [ 'test', 'template', [ 'var' => 'iable'], 10 ]], |
|
| 65 | + [['test', 'template'], ['test', 'template', [], 0]], |
|
| 66 | + [['test', 'template', ['var' => 'iable']], ['test', 'template', ['var' => 'iable'], 0]], |
|
| 67 | + [['test', 'template', 10], ['test', 'template', [], 10]], |
|
| 68 | + [['test', 'template', ['var' => 'iable'], 10], ['test', 'template', ['var' => 'iable'], 10]], |
|
| 69 | 69 | ]; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | public function provideAddViewVariablesTestData() |
| 92 | 92 | { |
| 93 | 93 | return [ |
| 94 | - [ [ 'test' ] , ['test', ['name' => 'test'], 0] ], |
|
| 95 | - [ [ 'test', [ 'var' => 'iable'] ], [ 'test', [ 'name' => 'test', 'var' => 'iable'], 0 ] ], |
|
| 96 | - [ [ 'test', [ 'var' => 'iable'], 10], [ 'test', [ 'name' => 'test', 'var' => 'iable'], 10 ]], |
|
| 97 | - [ [ [ 'name' => 'other', 'var' => 'test' ], 10], ['other', ['name' => 'other', 'var' => 'test' ], 10] ], |
|
| 98 | - [ [ 'test', ['name' => 'other'] ], [ 'test', [ 'name' => 'other' ], 0] ], |
|
| 99 | - [ [ 'test', 10 ], ['test', ['name' => 'test'], 10]], |
|
| 94 | + [['test'], ['test', ['name' => 'test'], 0]], |
|
| 95 | + [['test', ['var' => 'iable']], ['test', ['name' => 'test', 'var' => 'iable'], 0]], |
|
| 96 | + [['test', ['var' => 'iable'], 10], ['test', ['name' => 'test', 'var' => 'iable'], 10]], |
|
| 97 | + [[['name' => 'other', 'var' => 'test'], 10], ['other', ['name' => 'other', 'var' => 'test'], 10]], |
|
| 98 | + [['test', ['name' => 'other']], ['test', ['name' => 'other'], 0]], |
|
| 99 | + [['test', 10], ['test', ['name' => 'test'], 10]], |
|
| 100 | 100 | ]; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -80,17 +80,17 @@ discard block |
||
| 80 | 80 | $plugins->expects($this->any()) |
| 81 | 81 | ->method('get') |
| 82 | 82 | ->willReturnMap([ |
| 83 | - ['acl',null,$this->aclPlugin], |
|
| 84 | - ['params',null,$this->paramsPlugin] |
|
| 83 | + ['acl', null, $this->aclPlugin], |
|
| 84 | + ['params', null, $this->paramsPlugin] |
|
| 85 | 85 | ]) |
| 86 | 86 | ; |
| 87 | 87 | |
| 88 | 88 | $this->paramsPlugin->expects($this->any()) |
| 89 | 89 | ->method('__invoke') |
| 90 | 90 | ->willReturnMap([ |
| 91 | - [null,null,$this->paramsPlugin], |
|
| 92 | - ['filestore',null,'store.entity'], |
|
| 93 | - ['fileId',0,'dir/file.ext'] |
|
| 91 | + [null, null, $this->paramsPlugin], |
|
| 92 | + ['filestore', null, 'store.entity'], |
|
| 93 | + ['fileId', 0, 'dir/file.ext'] |
|
| 94 | 94 | ]) |
| 95 | 95 | ; |
| 96 | 96 | $this->paramsPlugin->expects($this->any()) |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ; |
| 121 | 121 | |
| 122 | 122 | $response = $this->controller->dispatch($request); |
| 123 | - $this->assertInstanceOf(Response::class,$response); |
|
| 123 | + $this->assertInstanceOf(Response::class, $response); |
|
| 124 | 124 | $this->assertResponseStatusCode(Response::STATUS_CODE_404); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ; |
| 138 | 138 | |
| 139 | 139 | $response = $this->controller->dispatch($request); |
| 140 | - $this->assertInstanceOf(Response::class,$response); |
|
| 140 | + $this->assertInstanceOf(Response::class, $response); |
|
| 141 | 141 | $this->assertResponseStatusCode(Response::STATUS_CODE_404); |
| 142 | 142 | $this->assertEquals( |
| 143 | 143 | $this->event->getParam('exception'), |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ; |
| 175 | 175 | |
| 176 | 176 | |
| 177 | - $resource = fopen(__FILE__,'r'); |
|
| 177 | + $resource = fopen(__FILE__, 'r'); |
|
| 178 | 178 | $file->expects($this->once()) |
| 179 | 179 | ->method('getResource') |
| 180 | 180 | ->willReturn($resource) |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | ob_end_clean(); |
| 187 | 187 | |
| 188 | 188 | $this->assertResponseStatusCode(Response::STATUS_CODE_200); |
| 189 | - $this->assertStringEqualsFile(__FILE__,$output); |
|
| 189 | + $this->assertStringEqualsFile(__FILE__, $output); |
|
| 190 | 190 | $this->assertEquals( |
| 191 | 191 | 'type', |
| 192 | 192 | $this->getResponseHeader('Content-Type')->getFieldValue() |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $request->setMethod(Request::METHOD_GET); |
| 204 | 204 | $headers = $request->getHeaders(); |
| 205 | 205 | $headers |
| 206 | - ->addHeaderLine('X_REQUESTED_WITH','XMLHttpRequest') |
|
| 206 | + ->addHeaderLine('X_REQUESTED_WITH', 'XMLHttpRequest') |
|
| 207 | 207 | ; |
| 208 | 208 | |
| 209 | 209 | $repo = $this->createMock(ObjectRepository::class); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ; |
| 222 | 222 | |
| 223 | 223 | $output = $this->controller->dispatch($request); |
| 224 | - $this->assertInstanceOf(JsonModel::class,$output); |
|
| 224 | + $this->assertInstanceOf(JsonModel::class, $output); |
|
| 225 | 225 | $this->assertEquals( |
| 226 | 226 | '{"result":false,"message":"File not found."}', |
| 227 | 227 | $output->serialize() |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $request = new Request(); |
| 234 | 234 | $headers = $request->getHeaders(); |
| 235 | 235 | $headers |
| 236 | - ->addHeaderLine('X_REQUESTED_WITH','XMLHttpRequest') |
|
| 236 | + ->addHeaderLine('X_REQUESTED_WITH', 'XMLHttpRequest') |
|
| 237 | 237 | ; |
| 238 | 238 | |
| 239 | 239 | $repo = $this->createMock(ObjectRepository::class); |
@@ -273,8 +273,8 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | /* @var \Zend\View\Model\JsonModel $output */ |
| 275 | 275 | $output = $this->controller->dispatch($request); |
| 276 | - $this->assertInstanceOf(JsonModel::class,$output); |
|
| 277 | - $this->assertEquals('{"result":true}',$output->serialize()); |
|
| 276 | + $this->assertInstanceOf(JsonModel::class, $output); |
|
| 277 | + $this->assertEquals('{"result":true}', $output->serialize()); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $request = $this->createMock(Request::class); |
| 46 | 46 | |
| 47 | 47 | $target = $this->getMockBuilder(ContentController::class) |
| 48 | - ->setMethods(['getRequest','getPluginManager']) |
|
| 48 | + ->setMethods(['getRequest', 'getPluginManager']) |
|
| 49 | 49 | ->getMock() |
| 50 | 50 | ; |
| 51 | 51 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $request->expects($this->exactly(2)) |
| 67 | 67 | ->method('isXmlHttpRequest') |
| 68 | - ->willReturnOnConsecutiveCalls(false,true) |
|
| 68 | + ->willReturnOnConsecutiveCalls(false, true) |
|
| 69 | 69 | ; |
| 70 | 70 | |
| 71 | 71 | $params->expects($this->exactly(2)) |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $viewModel = $target->indexAction(); |
| 79 | 79 | $this->assertEquals( |
| 80 | - 'content/some_view',$viewModel->getTemplate() |
|
| 80 | + 'content/some_view', $viewModel->getTemplate() |
|
| 81 | 81 | ); |
| 82 | 82 | $this->assertFalse($viewModel->terminate()); |
| 83 | 83 | |
| 84 | 84 | $viewModel = $target->indexAction(); |
| 85 | 85 | $this->assertEquals( |
| 86 | - 'content/some_view',$viewModel->getTemplate() |
|
| 86 | + 'content/some_view', $viewModel->getTemplate() |
|
| 87 | 87 | ); |
| 88 | 88 | $this->assertTrue($viewModel->terminate()); |
| 89 | 89 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $request = $this->createMock(Request::class); |
| 96 | 96 | |
| 97 | 97 | $target = $this->getMockBuilder(ContentController::class) |
| 98 | - ->setMethods(['getRequest','getPluginManager']) |
|
| 98 | + ->setMethods(['getRequest', 'getPluginManager']) |
|
| 99 | 99 | ->getMock() |
| 100 | 100 | ; |
| 101 | 101 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $request->expects($this->exactly(2)) |
| 117 | 117 | ->method('isXmlHttpRequest') |
| 118 | - ->willReturnOnConsecutiveCalls(false,true) |
|
| 118 | + ->willReturnOnConsecutiveCalls(false, true) |
|
| 119 | 119 | ; |
| 120 | 120 | |
| 121 | 121 | $params->expects($this->exactly(2)) |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $viewModel = $target->modalAction(); |
| 129 | 129 | $this->assertEquals( |
| 130 | - 'some_view',$viewModel->getTemplate() |
|
| 130 | + 'some_view', $viewModel->getTemplate() |
|
| 131 | 131 | ); |
| 132 | 132 | $this->assertFalse($viewModel->terminate()); |
| 133 | 133 | |
| 134 | 134 | $viewModel = $target->modalAction(); |
| 135 | 135 | $this->assertEquals( |
| 136 | - 'some_view',$viewModel->getTemplate() |
|
| 136 | + 'some_view', $viewModel->getTemplate() |
|
| 137 | 137 | ); |
| 138 | 138 | $this->assertTrue($viewModel->terminate()); |
| 139 | 139 | } |