@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | return [ |
| 59 | - [ [], 'testnameone', 'Test/Name.One', false ], |
|
| 60 | - [ $cfg1, 'testnametwo', 'Test.Name/Two', true ], |
|
| 61 | - [ $cfg1, 'othername', '', false ], |
|
| 62 | - [ $cfg1, 'nonexistant', 'Non.Existant', false ], |
|
| 59 | + [[], 'testnameone', 'Test/Name.One', false], |
|
| 60 | + [$cfg1, 'testnametwo', 'Test.Name/Two', true], |
|
| 61 | + [$cfg1, 'othername', '', false], |
|
| 62 | + [$cfg1, 'nonexistant', 'Non.Existant', false], |
|
| 63 | 63 | ]; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $services = $this->getServiceLocatorMock($optionsConfig); |
| 81 | 81 | |
| 82 | - $method = "assert" . ($expected ? 'True' : 'False'); |
|
| 82 | + $method = "assert".($expected ? 'True' : 'False'); |
|
| 83 | 83 | $this->$method($target->canCreateServiceWithName($services, $name, $requestedName)); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | return [ |
| 94 | - [ [], 'Test/Name.One', false ], |
|
| 95 | - [ $cfg1, 'Test.Name/Two', true ], |
|
| 96 | - [ $cfg1, 'othername', true ], |
|
| 97 | - [ $cfg1, 'Non.Existant', false ], |
|
| 94 | + [[], 'Test/Name.One', false], |
|
| 95 | + [$cfg1, 'Test.Name/Two', true], |
|
| 96 | + [$cfg1, 'othername', true], |
|
| 97 | + [$cfg1, 'Non.Existant', false], |
|
| 98 | 98 | ]; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $services = $this->getServiceLocatorMock([ |
| 145 | 145 | 'TestOption' => [ |
| 146 | - 'class' => __NAMESPACE__ . '\SimpleOptionsMock', |
|
| 146 | + 'class' => __NAMESPACE__.'\SimpleOptionsMock', |
|
| 147 | 147 | 'mode' => 'invalid', |
| 148 | 148 | ] |
| 149 | 149 | ]); |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function testCreatesSimpleOptionsInstance() |
| 160 | 160 | { |
| 161 | - $optionsMockClass = __NAMESPACE__ . '\SimpleOptionsMock'; |
|
| 161 | + $optionsMockClass = __NAMESPACE__.'\SimpleOptionsMock'; |
|
| 162 | 162 | $cfg = [ |
| 163 | 163 | 'SimpleOptions' => [ |
| 164 | 164 | 'class' => $optionsMockClass, |
| 165 | - 'options' => [ 'one' => 'three' ] |
|
| 165 | + 'options' => ['one' => 'three'] |
|
| 166 | 166 | ] |
| 167 | 167 | ]; |
| 168 | 168 | |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public function testCreateNestedOptionsInstance() |
| 205 | 205 | { |
| 206 | - $nestedOptionsMockClass = __NAMESPACE__ . '\NestedOptionsMock'; |
|
| 207 | - $simpleOptionsMockClass = __NAMESPACE__ . '\SimpleOptionsMock'; |
|
| 206 | + $nestedOptionsMockClass = __NAMESPACE__.'\NestedOptionsMock'; |
|
| 207 | + $simpleOptionsMockClass = __NAMESPACE__.'\SimpleOptionsMock'; |
|
| 208 | 208 | |
| 209 | 209 | $cfg = [ |
| 210 | 210 | 'NestedOptions' => [ |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | 'mode' => OptionsAbstractFactory::MODE_NESTED, |
| 213 | 213 | 'options' => [ |
| 214 | 214 | 'skalar' => 'itsworking', |
| 215 | - 'array' => [ 'its' => 'working' ], |
|
| 216 | - 'opt1' => [ '__class__' => $simpleOptionsMockClass ], |
|
| 217 | - 'opt2' => [ '__class__' => $simpleOptionsMockClass, 'two' => 'four' ], |
|
| 215 | + 'array' => ['its' => 'working'], |
|
| 216 | + 'opt1' => ['__class__' => $simpleOptionsMockClass], |
|
| 217 | + 'opt2' => ['__class__' => $simpleOptionsMockClass, 'two' => 'four'], |
|
| 218 | 218 | ], |
| 219 | 219 | ], |
| 220 | 220 | ]; |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | $this->assertInstanceOf($nestedOptionsMockClass, $options); |
| 230 | 230 | $this->assertEquals('itsworking', $options->getSkalar()); |
| 231 | - $this->assertEquals([ 'its' => 'working' ], $options->getArray()); |
|
| 231 | + $this->assertEquals(['its' => 'working'], $options->getArray()); |
|
| 232 | 232 | $this->assertEquals('One', $options->getOpt1()->getOne()); |
| 233 | 233 | $this->assertEquals('four', $options->getOpt2()->getTwo()); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | protected function getServiceLocatorMock($optionsConfig = []) |
| 237 | 237 | { |
| 238 | - $optionsConfig = [ 'options' => $optionsConfig ]; |
|
| 238 | + $optionsConfig = ['options' => $optionsConfig]; |
|
| 239 | 239 | $services = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
| 240 | 240 | |
| 241 | 241 | $services->expects($this->once())->method('get')->with('config')->willReturn($optionsConfig); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | class SimpleOptionsMock extends AbstractOptions |
| 248 | 248 | { |
| 249 | 249 | protected $one = "One"; |
| 250 | - protected $two= "Two"; |
|
| 250 | + protected $two = "Two"; |
|
| 251 | 251 | |
| 252 | 252 | /** |
| 253 | 253 | * @param string $one |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | '@testCreateService' => ['mock' => ['__invoke' => ['@with' => 'getInvokationMockArgs', 'count' => 1]]], |
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 44 | + private $inheritance = [FactoryInterface::class]; |
|
| 45 | 45 | |
| 46 | 46 | private function getInvokationMockArgs() |
| 47 | 47 | { |
@@ -88,6 +88,6 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $this->fail('Imagine instance creation for ' .$lib . ' failed.'); |
|
| 91 | + $this->fail('Imagine instance creation for '.$lib.' failed.'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ], |
| 52 | 52 | ]; |
| 53 | 53 | |
| 54 | - private $inheritance = [ FactoryInterface::class]; |
|
| 54 | + private $inheritance = [FactoryInterface::class]; |
|
| 55 | 55 | |
| 56 | 56 | public function testSetCreationOptions() |
| 57 | 57 | { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $services = new ServiceManager(); |
| 70 | 70 | $forms = new FormElementManagerV3Polyfill($services); |
| 71 | 71 | |
| 72 | - $options = [ 'test' => 'work?' ]; |
|
| 72 | + $options = ['test' => 'work?']; |
|
| 73 | 73 | $this->target->setCreationOptions($options); |
| 74 | 74 | |
| 75 | 75 | $this->target |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | public function provideMissingOptions() |
| 87 | 87 | { |
| 88 | 88 | return [ |
| 89 | - [ null ], |
|
| 90 | - [ [] ], |
|
| 91 | - [ ['tree' => ['value' => 'test']] ], |
|
| 92 | - [ ['tree' => ['entity' => 'test']] ], |
|
| 93 | - [ ['tree' => ['name' => 'test']] ], |
|
| 89 | + [null], |
|
| 90 | + [[]], |
|
| 91 | + [['tree' => ['value' => 'test']]], |
|
| 92 | + [['tree' => ['entity' => 'test']]], |
|
| 93 | + [['tree' => ['name' => 'test']]], |
|
| 94 | 94 | ]; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $this->expectException(\RuntimeException::class); |
| 123 | 123 | $this->expectExceptionMessage('Tree root not found'); |
| 124 | 124 | |
| 125 | - $this->target->__invoke($services, '', ['tree' => [ 'entity' => 'testEntityRepository', 'value' => 'test']]); |
|
| 125 | + $this->target->__invoke($services, '', ['tree' => ['entity' => 'testEntityRepository', 'value' => 'test']]); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - private function getServiceContainer($criteria, $root=null) |
|
| 128 | + private function getServiceContainer($criteria, $root = null) |
|
| 129 | 129 | { |
| 130 | 130 | if (null === $root) { |
| 131 | 131 | $root = new Node('Test'); |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | $root3 = $this->createRoot('root', ['child1' => ['gChild11', 'gChild12']]); |
| 189 | 189 | |
| 190 | 190 | return [ |
| 191 | - [ $root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
| 192 | - [ $root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
| 193 | - [ $root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]] ] |
|
| 191 | + [$root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
| 192 | + [$root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
| 193 | + [$root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]] |
|
| 194 | 194 | ]; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | $services = new ServiceManager(); |
| 48 | 48 | $this->assertTrue( |
| 49 | 49 | $this->target->canCreate( |
| 50 | - $services, |
|
| 51 | - 'Any.string/Value/Events' |
|
| 52 | - ), |
|
| 50 | + $services, |
|
| 51 | + 'Any.string/Value/Events' |
|
| 52 | + ), |
|
| 53 | 53 | 'Checking correct name failed.' |
| 54 | 54 | ); |
| 55 | 55 | $this->assertFalse( |
| 56 | 56 | $this->target->canCreate( |
| 57 | - $services, |
|
| 58 | - 'Any.string.not.ending/in/Events.but has it in the middle!' |
|
| 59 | - ), |
|
| 57 | + $services, |
|
| 58 | + 'Any.string.not.ending/in/Events.but has it in the middle!' |
|
| 59 | + ), |
|
| 60 | 60 | 'Checking invalid name failed.' |
| 61 | 61 | ); |
| 62 | 62 | } |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | /* @var EventManagerAbstractFactory|\PHPUnit_Framework_MockObject_MockObject $target */ |
| 100 | 100 | $target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 101 | - ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 102 | - ->getMock(); |
|
| 101 | + ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 102 | + ->getMock(); |
|
| 103 | 103 | |
| 104 | 104 | $services = new ServiceManager(); |
| 105 | 105 | $services->setService('Config', $config); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | '@testCanCreateServiceWithName' => ['mock' => ['canCreate' => 1]], |
| 41 | 41 | ]; |
| 42 | 42 | |
| 43 | - protected $inheritance = [ '\Zend\ServiceManager\Factory\AbstractFactoryInterface' ]; |
|
| 43 | + protected $inheritance = ['\Zend\ServiceManager\Factory\AbstractFactoryInterface']; |
|
| 44 | 44 | |
| 45 | 45 | public function testDeterminesIfItCanCreateAnEventManagerByName() |
| 46 | 46 | { |
@@ -66,17 +66,17 @@ discard block |
||
| 66 | 66 | $config1 = []; |
| 67 | 67 | |
| 68 | 68 | $config2 = [ |
| 69 | - 'event_manager' => [ 'Test2/Events' => [ |
|
| 69 | + 'event_manager' => ['Test2/Events' => [ |
|
| 70 | 70 | 'service' => 'TestService', |
| 71 | 71 | 'configure' => false, |
| 72 | - 'identifiers' => [ 'TestEvents', 'AnotherId' ], |
|
| 72 | + 'identifiers' => ['TestEvents', 'AnotherId'], |
|
| 73 | 73 | 'event' => 'SomeEventClass', |
| 74 | - 'listeners' => [ 'listener' => 'event' ] |
|
| 74 | + 'listeners' => ['listener' => 'event'] |
|
| 75 | 75 | ]] |
| 76 | 76 | ]; |
| 77 | 77 | return [ |
| 78 | - [ $config1, 'Test1/Events' ], |
|
| 79 | - [ $config2, 'Test2/Events' ], |
|
| 78 | + [$config1, 'Test1/Events'], |
|
| 79 | + [$config2, 'Test2/Events'], |
|
| 80 | 80 | ]; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | $defaults = [ |
| 92 | 92 | 'service' => 'EventManager', |
| 93 | 93 | 'configure' => true, |
| 94 | - 'identifiers' => [ $reqName ], |
|
| 94 | + 'identifiers' => [$reqName], |
|
| 95 | 95 | 'event' => '\Zend\EventManager\Event', |
| 96 | 96 | 'listeners' => [], |
| 97 | 97 | ]; |
| 98 | 98 | |
| 99 | 99 | /* @var EventManagerAbstractFactory|\PHPUnit_Framework_MockObject_MockObject $target */ |
| 100 | 100 | $target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 101 | - ->setMethods([ 'createEventManager', 'attachListeners' ]) |
|
| 101 | + ->setMethods(['createEventManager', 'attachListeners']) |
|
| 102 | 102 | ->getMock(); |
| 103 | 103 | |
| 104 | 104 | $services = new ServiceManager(); |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | protected function setUp() |
| 42 | 42 | { |
| 43 | 43 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 44 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 45 | - ->getMock(); |
|
| 44 | + ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 45 | + ->getMock(); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | protected function setTargetConfig($config) |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | protected function getServiceManagerMock($events, $args = []) |
| 70 | 70 | { |
| 71 | 71 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
| 72 | - ->disableOriginalConstructor() |
|
| 73 | - ->getMock(); |
|
| 72 | + ->disableOriginalConstructor() |
|
| 73 | + ->getMock(); |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | if (is_Array($events)) { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ->will($this->returnValueMap($hasMap)) |
| 102 | 102 | ; |
| 103 | 103 | $services->expects($this->exactly(count($getMap))) |
| 104 | - ->method('get')->will($this->returnValueMap($getMap)); |
|
| 104 | + ->method('get')->will($this->returnValueMap($getMap)); |
|
| 105 | 105 | |
| 106 | 106 | return $services; |
| 107 | 107 | } |
@@ -179,9 +179,9 @@ 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 | 187 | ->expects($this->once()) |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | protected function setUp() |
| 42 | 42 | { |
| 43 | 43 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 44 | - ->setMethods([ 'attachListeners', 'getConfig' ]) |
|
| 44 | + ->setMethods(['attachListeners', 'getConfig']) |
|
| 45 | 45 | ->getMock(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $config['listeners'] = []; |
| 55 | 55 | } |
| 56 | 56 | if (!isset($config['identifiers'])) { |
| 57 | - $config['identifiers'] = [ 'Test/Events/Manager' ]; |
|
| 57 | + $config['identifiers'] = ['Test/Events/Manager']; |
|
| 58 | 58 | } |
| 59 | 59 | if (!isset($config['event'])) { |
| 60 | 60 | $config['event'] = '\Zend\EventManager\Event'; |
@@ -81,15 +81,15 @@ discard block |
||
| 81 | 81 | $eventsService = 'Test/Events/Manager'; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $hasMap = [ [ $eventsService, true ] ]; |
|
| 85 | - $getMap = [ [ $eventsService, $events ] ]; |
|
| 84 | + $hasMap = [[$eventsService, true]]; |
|
| 85 | + $getMap = [[$eventsService, $events]]; |
|
| 86 | 86 | |
| 87 | 87 | foreach ($args as $serviceName => $serviceValue) { |
| 88 | 88 | if (false === $serviceValue) { |
| 89 | - $hasMap[] = [ $serviceName, true ]; |
|
| 89 | + $hasMap[] = [$serviceName, true]; |
|
| 90 | 90 | } else { |
| 91 | - $hasMap[] = [ $serviceName, true]; |
|
| 92 | - $getMap[] = [ $serviceName, $serviceValue ]; |
|
| 91 | + $hasMap[] = [$serviceName, true]; |
|
| 92 | + $getMap[] = [$serviceName, $serviceValue]; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $services->setService('Test/Events/Manager', $events); |
| 115 | 115 | |
| 116 | - $this->setTargetConfig([ 'service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
| 116 | + $this->setTargetConfig(['service' => 'Test/Events/Manager', 'configure' => false, 'listeners' => []]); |
|
| 117 | 117 | |
| 118 | 118 | $this->target->expects($this->once())->method('attachListeners')->with($services, $events, []); |
| 119 | 119 | $this->target->createServiceWithName($services, 'irrelevant', 'Test/Events'); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | public function testInstatiatesEventManagerFromClassName() |
| 123 | 123 | { |
| 124 | - $this->setTargetConfig([ 'service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
| 124 | + $this->setTargetConfig(['service' => '\Zend\EventManager\EventManager', 'configure' => false, 'listeners' => []]); |
|
| 125 | 125 | |
| 126 | 126 | $services = new ServiceManager(); |
| 127 | 127 | $events = $this->target->createServiceWithName($services, 'irrelevant', 'irrelevant'); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $this->expectException(\UnexpectedValueException::class); |
| 135 | 135 | $this->expectExceptionMessage('Cannot create'); |
| 136 | 136 | |
| 137 | - $this->setTargetConfig(['service' => 'NonExistantClass' ]); |
|
| 137 | + $this->setTargetConfig(['service' => 'NonExistantClass']); |
|
| 138 | 138 | |
| 139 | 139 | $this->target->createServiceWithName(new ServiceManager(), 'irrelevant', 'irrelevant'); |
| 140 | 140 | } |
@@ -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 | } |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | protected function setUp() |
| 47 | 47 | { |
| 48 | 48 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 49 | - ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 50 | - ->getMock(); |
|
| 49 | + ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 50 | + ->getMock(); |
|
| 51 | 51 | |
| 52 | 52 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
| 53 | - ->disableOriginalConstructor() |
|
| 54 | - ->setMethods(['attach']) |
|
| 55 | - ->getMock(); |
|
| 53 | + ->disableOriginalConstructor() |
|
| 54 | + ->setMethods(['attach']) |
|
| 55 | + ->getMock(); |
|
| 56 | 56 | |
| 57 | 57 | $this->target->expects($this->once())->method('createEventManager')->willReturn($events); |
| 58 | 58 | $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 = [ ]; |
@@ -101,8 +101,8 @@ discard block |
||
| 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; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public function testCallsAttachOnListenerAggregates() |
| 167 | 167 | { |
| 168 | 168 | $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface') |
| 169 | - ->getMockForAbstractClass(); |
|
| 169 | + ->getMockForAbstractClass(); |
|
| 170 | 170 | $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]); |
| 171 | 171 | |
| 172 | 172 | $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | protected function setUp() |
| 47 | 47 | { |
| 48 | 48 | $this->target = $this->getMockBuilder('\Core\Factory\EventManager\EventManagerAbstractFactory') |
| 49 | - ->setMethods([ 'createEventManager', 'getConfig' ]) |
|
| 49 | + ->setMethods(['createEventManager', 'getConfig']) |
|
| 50 | 50 | ->getMock(); |
| 51 | 51 | |
| 52 | 52 | $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 |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | $aggregateMock = $this->getMockBuilder('\Zend\EventManager\ListenerAggregateInterface') |
| 169 | 169 | ->getMockForAbstractClass(); |
| 170 | - $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([ $this->events, 1], [$this->events, -100]); |
|
| 170 | + $aggregateMock->expects($this->exactly(2))->method('attach')->withConsecutive([$this->events, 1], [$this->events, -100]); |
|
| 171 | 171 | |
| 172 | 172 | $this->setTargetListenerConfig(['TestAggregate', 'TestAggregate2' => -100]); |
| 173 | 173 | $services = $this->getServiceManagerMock(['TestAggregate' => $aggregateMock, 'TestAggregate2' => $aggregateMock]); |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $listenerMock = new AttachListenerTestListenerMock(); |
| 181 | 181 | $this->setTargetListenerConfig([ |
| 182 | - 'TestListener1' => ['test-event1','doSomething',1], |
|
| 183 | - 'TestListener2' => ['test-event2','doSomething',2] |
|
| 182 | + 'TestListener1' => ['test-event1', 'doSomething', 1], |
|
| 183 | + 'TestListener2' => ['test-event2', 'doSomething', 2] |
|
| 184 | 184 | ]); |
| 185 | 185 | $services = $this->getServiceManagerMock([ |
| 186 | 186 | 'TestListener1' => $listenerMock, |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | ->expects($this->exactly(2)) |
| 191 | 191 | ->method('attach') |
| 192 | 192 | ->withConsecutive( |
| 193 | - ['test-event1', [$listenerMock,'doSomething'], 1 ], |
|
| 194 | - ['test-event2', [$listenerMock, 'doSomething'], 2 ] |
|
| 193 | + ['test-event1', [$listenerMock, 'doSomething'], 1], |
|
| 194 | + ['test-event2', [$listenerMock, 'doSomething'], 2] |
|
| 195 | 195 | ) |
| 196 | 196 | ; |
| 197 | 197 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $listenerMock = new AttachListenerTestListenerMock(); |
| 204 | 204 | $singleEvent = 'event'; |
| 205 | 205 | $expectSingleEvent = $singleEvent; |
| 206 | - $multiEvent = [ 'event1', 'event2' ]; |
|
| 206 | + $multiEvent = ['event1', 'event2']; |
|
| 207 | 207 | $method = 'doSomething'; |
| 208 | 208 | $additionalMethod = 'doSomethingElse'; |
| 209 | 209 | $priority = 1; |
@@ -212,30 +212,30 @@ discard block |
||
| 212 | 212 | $notLazy = false; |
| 213 | 213 | |
| 214 | 214 | $listeners = [ |
| 215 | - 'Test01' => [ $singleEvent, $method], |
|
| 216 | - 'Test02' => [ $singleEvent, $method ], |
|
| 217 | - 'Test03' => [ $multiEvent, $method ], |
|
| 218 | - 'Test04' => [ $singleEvent, $method ], |
|
| 219 | - 'Test05' => [ $multiEvent, $method ], |
|
| 220 | - 'Test06' => [ $singleEvent, $method, $priority ], |
|
| 221 | - 'Test07' => [ $multiEvent, $method, $priority ], |
|
| 222 | - 'Test08' => [ $singleEvent, $method, $priority, $lazy ], |
|
| 223 | - 'Test09' => [ $multiEvent, $method, $priority, $lazy ], |
|
| 224 | - 'Test10' => [ $singleEvent,$method, $priority ], |
|
| 225 | - 'Test11' => [ $multiEvent, $method, $priority ], |
|
| 226 | - 'Test12' => [ $singleEvent,$method, $lazy ], |
|
| 227 | - 'Test13' => [ $multiEvent,$method, $lazy ], |
|
| 228 | - 'Test14' => [ $singleEvent, $method, $additionalMethod ], |
|
| 229 | - 'Test15' => [ $multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority ], |
|
| 215 | + 'Test01' => [$singleEvent, $method], |
|
| 216 | + 'Test02' => [$singleEvent, $method], |
|
| 217 | + 'Test03' => [$multiEvent, $method], |
|
| 218 | + 'Test04' => [$singleEvent, $method], |
|
| 219 | + 'Test05' => [$multiEvent, $method], |
|
| 220 | + 'Test06' => [$singleEvent, $method, $priority], |
|
| 221 | + 'Test07' => [$multiEvent, $method, $priority], |
|
| 222 | + 'Test08' => [$singleEvent, $method, $priority, $lazy], |
|
| 223 | + 'Test09' => [$multiEvent, $method, $priority, $lazy], |
|
| 224 | + 'Test10' => [$singleEvent, $method, $priority], |
|
| 225 | + 'Test11' => [$multiEvent, $method, $priority], |
|
| 226 | + 'Test12' => [$singleEvent, $method, $lazy], |
|
| 227 | + 'Test13' => [$multiEvent, $method, $lazy], |
|
| 228 | + 'Test14' => [$singleEvent, $method, $additionalMethod], |
|
| 229 | + 'Test15' => [$multiEvent, $method, $lazy, $priority, $notLazy, $additionalPriority], |
|
| 230 | 230 | ]; |
| 231 | 231 | |
| 232 | 232 | $expectedLazyListeners = [ |
| 233 | - [ 'service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority ], |
|
| 234 | - [ 'service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority ], |
|
| 235 | - [ 'service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority ], |
|
| 236 | - [ 'service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1 ], |
|
| 237 | - [ 'service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1], |
|
| 238 | - [ 'service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1], |
|
| 233 | + ['service' => 'Test08', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => $priority], |
|
| 234 | + ['service' => 'Test09', 'event' => 'event1', 'method' => $method, 'priority' => $priority], |
|
| 235 | + ['service' => 'Test09', 'event' => 'event2', 'method' => $method, 'priority' => $priority], |
|
| 236 | + ['service' => 'Test12', 'event' => $expectSingleEvent, 'method' => $method, 'priority' => 1], |
|
| 237 | + ['service' => 'Test13', 'event' => 'event1', 'method' => $method, 'priority' => 1], |
|
| 238 | + ['service' => 'Test13', 'event' => 'event2', 'method' => $method, 'priority' => 1], |
|
| 239 | 239 | ]; |
| 240 | 240 | |
| 241 | 241 | $servicesCfg = array_fill_keys([ |
@@ -252,26 +252,26 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | $this->setTargetListenerConfig($listeners); |
| 254 | 254 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 255 | - $expectedCallback = [$listenerMock,'doSomething']; |
|
| 255 | + $expectedCallback = [$listenerMock, 'doSomething']; |
|
| 256 | 256 | $this->events->expects($this->exactly(16)) |
| 257 | 257 | ->method('attach') |
| 258 | 258 | ->withConsecutive( |
| 259 | - [ $expectSingleEvent, $expectedCallback, 1 ], |
|
| 260 | - [ $expectSingleEvent, $expectedCallback, 1 ], |
|
| 261 | - [ 'event1', $expectedCallback, 1], |
|
| 262 | - [ 'event2', $expectedCallback, 1], |
|
| 263 | - [ $expectSingleEvent, $expectedCallback, 1], |
|
| 264 | - [ 'event1', $expectedCallback, 1], |
|
| 265 | - [ 'event2', $expectedCallback, 1], |
|
| 266 | - [ $expectSingleEvent, $expectedCallback, $priority], |
|
| 267 | - [ 'event1', $expectedCallback, $priority], |
|
| 268 | - [ 'event2', $expectedCallback, $priority], |
|
| 269 | - [ $expectSingleEvent, $expectedCallback, $priority ], |
|
| 270 | - [ 'event1', $expectedCallback, $priority ], |
|
| 271 | - [ 'event2', $expectedCallback, $priority ], |
|
| 272 | - [ $expectSingleEvent, [$listenerMock,$additionalMethod], 1], |
|
| 273 | - [ 'event1', $expectedCallback, $additionalPriority ], |
|
| 274 | - [ 'event2', $expectedCallback, $additionalPriority ] |
|
| 259 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 260 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 261 | + ['event1', $expectedCallback, 1], |
|
| 262 | + ['event2', $expectedCallback, 1], |
|
| 263 | + [$expectSingleEvent, $expectedCallback, 1], |
|
| 264 | + ['event1', $expectedCallback, 1], |
|
| 265 | + ['event2', $expectedCallback, 1], |
|
| 266 | + [$expectSingleEvent, $expectedCallback, $priority], |
|
| 267 | + ['event1', $expectedCallback, $priority], |
|
| 268 | + ['event2', $expectedCallback, $priority], |
|
| 269 | + [$expectSingleEvent, $expectedCallback, $priority], |
|
| 270 | + ['event1', $expectedCallback, $priority], |
|
| 271 | + ['event2', $expectedCallback, $priority], |
|
| 272 | + [$expectSingleEvent, [$listenerMock, $additionalMethod], 1], |
|
| 273 | + ['event1', $expectedCallback, $additionalPriority], |
|
| 274 | + ['event2', $expectedCallback, $additionalPriority] |
|
| 275 | 275 | ); |
| 276 | 276 | |
| 277 | 277 | $this->target->createServiceWithName($services, '', ''); |
@@ -280,32 +280,32 @@ discard block |
||
| 280 | 280 | public function testNormalizeListenerOptionsWithArrayHashSpecification() |
| 281 | 281 | { |
| 282 | 282 | $listenerMock = new AttachListenerTestListenerMock(); |
| 283 | - $singleEvent = [ 'singleEvent' ]; |
|
| 284 | - $priorityEvent = [ 'prioEvent' => 10 ]; |
|
| 285 | - $methodEvent = [ 'methodEvent' => 'doSomething' ]; |
|
| 286 | - $singleAndPriorityAndMethodEvent = [ 'single', 'priority' => 10, 'method' => 'doSomething']; |
|
| 287 | - $verboseEvent = [ 'verbose' => [ 'method' => 'doSomething', 'priority' => 20]]; |
|
| 288 | - $verboseFullEvent = [ 'verbose' => [ 'method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]]; |
|
| 289 | - $multiEvent = [ 'multi1', 'multi2' ]; |
|
| 283 | + $singleEvent = ['singleEvent']; |
|
| 284 | + $priorityEvent = ['prioEvent' => 10]; |
|
| 285 | + $methodEvent = ['methodEvent' => 'doSomething']; |
|
| 286 | + $singleAndPriorityAndMethodEvent = ['single', 'priority' => 10, 'method' => 'doSomething']; |
|
| 287 | + $verboseEvent = ['verbose' => ['method' => 'doSomething', 'priority' => 20]]; |
|
| 288 | + $verboseFullEvent = ['verbose' => ['method' => ['doSomething', 'doSomethingElse' => 25], 'priority' => 30]]; |
|
| 289 | + $multiEvent = ['multi1', 'multi2']; |
|
| 290 | 290 | |
| 291 | 291 | $listeners = [ |
| 292 | - 'Test01' => [ 'events' => $singleEvent, 'method' => 'doSomething'], |
|
| 293 | - 'Test02' => [ 'events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 294 | - 'Test03' => [ 'events' => $methodEvent, 'method' => 'doSomething'], |
|
| 295 | - 'Test04' => [ 'events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 296 | - 'Test05' => [ 'events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 297 | - 'Test06' => [ 'events' => $methodEvent,'method'=>'doSomething', 'priority' => 12], |
|
| 298 | - 'Test07' => [ 'events' => $singleEvent, 'method' => 'doSomething'], |
|
| 299 | - 'Test08' => [ 'events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 300 | - 'Test09' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse'], |
|
| 301 | - 'Test10' => [ 'events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12], |
|
| 302 | - 'Test11' => [ 'events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 303 | - 'Test12' => [ 'events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 304 | - 'Test13' => [ 'events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'], |
|
| 305 | - 'Test14' => [ 'events' => $verboseEvent], |
|
| 306 | - 'Test15' => [ 'events' => $verboseFullEvent], |
|
| 307 | - 'Test16' => [ 'events' => $singleEvent, 'lazy' => true], |
|
| 308 | - 'Test17' => [ 'events' => $multiEvent, 'method' => 'multiMethod' ], |
|
| 292 | + 'Test01' => ['events' => $singleEvent, 'method' => 'doSomething'], |
|
| 293 | + 'Test02' => ['events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 294 | + 'Test03' => ['events' => $methodEvent, 'method' => 'doSomething'], |
|
| 295 | + 'Test04' => ['events' => $singleEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 296 | + 'Test05' => ['events' => $priorityEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 297 | + 'Test06' => ['events' => $methodEvent, 'method'=>'doSomething', 'priority' => 12], |
|
| 298 | + 'Test07' => ['events' => $singleEvent, 'method' => 'doSomething'], |
|
| 299 | + 'Test08' => ['events' => $priorityEvent, 'method' => 'doSomething'], |
|
| 300 | + 'Test09' => ['events' => $methodEvent, 'method' => 'doSomethingElse'], |
|
| 301 | + 'Test10' => ['events' => $singleEvent, 'method' => 'doSomething', 'priority' => 12], |
|
| 302 | + 'Test11' => ['events' => $priorityEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 303 | + 'Test12' => ['events' => $methodEvent, 'method' => 'doSomethingElse', 'priority' => 12], |
|
| 304 | + 'Test13' => ['events' => $singleAndPriorityAndMethodEvent, 'method'=> 'doSomething'], |
|
| 305 | + 'Test14' => ['events' => $verboseEvent], |
|
| 306 | + 'Test15' => ['events' => $verboseFullEvent], |
|
| 307 | + 'Test16' => ['events' => $singleEvent, 'lazy' => true], |
|
| 308 | + 'Test17' => ['events' => $multiEvent, 'method' => 'multiMethod'], |
|
| 309 | 309 | ]; |
| 310 | 310 | |
| 311 | 311 | $servicesCfg = array_fill_keys([ |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | 'Test15', 'Test17', |
| 315 | 315 | ], $listenerMock); |
| 316 | 316 | $expectedLazyListeners = [ |
| 317 | - [ 'service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1 ], |
|
| 317 | + ['service' => 'Test16', 'event' => $singleEvent[0], 'method' => null, 'priority' => 1], |
|
| 318 | 318 | ]; |
| 319 | 319 | |
| 320 | 320 | $lazyAggregateMock = $this->getLazyAggregateMock(); |
@@ -328,33 +328,33 @@ discard block |
||
| 328 | 328 | $this->setTargetListenerConfig($listeners); |
| 329 | 329 | $services = $this->getServiceManagerMock($servicesCfg, true); |
| 330 | 330 | |
| 331 | - $callback1 = [$listenerMock,'doSomething']; |
|
| 332 | - $callback2 = [$listenerMock,'doSomethingElse']; |
|
| 331 | + $callback1 = [$listenerMock, 'doSomething']; |
|
| 332 | + $callback2 = [$listenerMock, 'doSomethingElse']; |
|
| 333 | 333 | $this->events |
| 334 | 334 | ->expects($this->exactly(20)) |
| 335 | 335 | ->method('attach') |
| 336 | 336 | ->withConsecutive( |
| 337 | - [ $singleEvent[0], $callback1, 1 ], |
|
| 338 | - [ 'prioEvent', $callback1, 10 ], |
|
| 339 | - [ 'methodEvent', $callback1, 1], |
|
| 340 | - [ $singleEvent[0], $callback1, 12], |
|
| 341 | - [ 'prioEvent', $callback1, 10], |
|
| 342 | - [ 'methodEvent', $callback1, 12], |
|
| 343 | - [ $singleEvent[0], $callback1, 1], |
|
| 344 | - [ 'prioEvent' , $callback1, 10], |
|
| 345 | - [ 'methodEvent', $callback1, 1], |
|
| 346 | - [ $singleEvent[0], $callback1, 12], |
|
| 347 | - [ 'prioEvent', $callback2, 10], |
|
| 348 | - [ 'methodEvent', $callback1, 12], |
|
| 349 | - [ 'single', $callback1, 1 ], |
|
| 350 | - [ 'method' , $callback1, 1], |
|
| 351 | - [ 'priority', $callback1, 10], |
|
| 337 | + [$singleEvent[0], $callback1, 1], |
|
| 338 | + ['prioEvent', $callback1, 10], |
|
| 339 | + ['methodEvent', $callback1, 1], |
|
| 340 | + [$singleEvent[0], $callback1, 12], |
|
| 341 | + ['prioEvent', $callback1, 10], |
|
| 342 | + ['methodEvent', $callback1, 12], |
|
| 343 | + [$singleEvent[0], $callback1, 1], |
|
| 344 | + ['prioEvent', $callback1, 10], |
|
| 345 | + ['methodEvent', $callback1, 1], |
|
| 346 | + [$singleEvent[0], $callback1, 12], |
|
| 347 | + ['prioEvent', $callback2, 10], |
|
| 348 | + ['methodEvent', $callback1, 12], |
|
| 349 | + ['single', $callback1, 1], |
|
| 350 | + ['method', $callback1, 1], |
|
| 351 | + ['priority', $callback1, 10], |
|
| 352 | 352 | //[ [ 'method' ], $callback1, 1], |
| 353 | - [ 'verbose', $callback1, 20], |
|
| 354 | - [ 'verbose', $callback1, 30], |
|
| 355 | - [ 'verbose', $callback2, 25], |
|
| 356 | - [ 'multi1', [$listenerMock,'multiMethod'], 1], |
|
| 357 | - [ 'multi2', [$listenerMock,'multiMethod'], 1] |
|
| 353 | + ['verbose', $callback1, 20], |
|
| 354 | + ['verbose', $callback1, 30], |
|
| 355 | + ['verbose', $callback2, 25], |
|
| 356 | + ['multi1', [$listenerMock, 'multiMethod'], 1], |
|
| 357 | + ['multi2', [$listenerMock, 'multiMethod'], 1] |
|
| 358 | 358 | ) |
| 359 | 359 | ; |
| 360 | 360 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | '@testCreateService' => ['mock' => ['__invoke']], |
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 47 | + private $inheritance = [FactoryInterface::class]; |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testCreateService() |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $options = new ModuleOptions(); |
| 47 | 47 | $config = ['testwert']; |
| 48 | 48 | |
| 49 | - $HauptServiceLocator = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
|
| 49 | + $HauptServiceLocator = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
|
| 50 | 50 | $HauptServiceLocator->expects($this->exactly(2))->method('get')->withConsecutive(['Auth/Options'], ['Config'])->will($this->onConsecutiveCalls($options, $config)); |
| 51 | 51 | |
| 52 | 52 | $target = new SocialButtonsFactory(); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $qb->expects($this->once())->method('getQuery')->willReturn($q); |
| 101 | 101 | |
| 102 | 102 | $repositories = $this->getMockBuilder('\Core\Repository\RepositoryService') |
| 103 | - ->disableOriginalConstructor()->getMock(); |
|
| 103 | + ->disableOriginalConstructor()->getMock(); |
|
| 104 | 104 | |
| 105 | 105 | $repositories->expects($this->once())->method('createQueryBuilder')->willReturn($qb); |
| 106 | 106 | |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
| 121 | 121 | |
| 122 | 122 | $sm->expects($this->exactly(2))->method('get') |
| 123 | - ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 124 | - ->will($this->onConsecutiveCalls($repositories, $filters)); |
|
| 123 | + ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 124 | + ->will($this->onConsecutiveCalls($repositories, $filters)); |
|
| 125 | 125 | |
| 126 | 126 | $target = $this->target; |
| 127 | 127 | $paginator = $target($sm, $serviceName, $options); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | public function serviceNamesProvider() |
| 45 | 45 | { |
| 46 | 46 | return [ |
| 47 | - [ 'Repository/Core/FileEntity', true ], |
|
| 48 | - [ 'Core/FileEntity', true ], |
|
| 49 | - [ 'Repository/NoModuleWillBeEverCalledThat/SomeEntity', false ], |
|
| 50 | - [ 'ThisIsAHighlyUnCommonModuleName/ObscureEntity', false ], |
|
| 47 | + ['Repository/Core/FileEntity', true], |
|
| 48 | + ['Core/FileEntity', true], |
|
| 49 | + ['Repository/NoModuleWillBeEverCalledThat/SomeEntity', false], |
|
| 50 | + ['ThisIsAHighlyUnCommonModuleName/ObscureEntity', false], |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->disableOriginalConstructor() |
| 66 | 66 | ->getMock() |
| 67 | 67 | ; |
| 68 | - $method = "assert" . ($expected ? 'True' : 'False'); |
|
| 68 | + $method = "assert".($expected ? 'True' : 'False'); |
|
| 69 | 69 | |
| 70 | 70 | $this->{$method}($this->target->canCreate($sm, $serviceName)); |
| 71 | 71 | } |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | public function servicesProvider() |
| 74 | 74 | { |
| 75 | 75 | return [ |
| 76 | - [ 'Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false ], |
|
| 77 | - [ 'Core/TestEntity', '\Core\Entity\TestEntity', [ 'testOption' => 'testValue' ], true ] |
|
| 76 | + ['Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false], |
|
| 77 | + ['Core/TestEntity', '\Core\Entity\TestEntity', ['testOption' => 'testValue'], true] |
|
| 78 | 78 | ]; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -108,19 +108,19 @@ discard block |
||
| 108 | 108 | ->disableOriginalConstructor() |
| 109 | 109 | ->setMethods(['has', 'get'])->getMockForAbstractClass(); |
| 110 | 110 | |
| 111 | - $filters->expects($this->once())->method('has')->with('PaginationQuery/' . $serviceName)->willReturn($hasFilter); |
|
| 111 | + $filters->expects($this->once())->method('has')->with('PaginationQuery/'.$serviceName)->willReturn($hasFilter); |
|
| 112 | 112 | |
| 113 | 113 | if ($hasFilter) { |
| 114 | 114 | $filter = $this->getMockBuilder('\Zend\Filter\FilterInterface')->getMockForAbstractClass(); |
| 115 | 115 | $filter->expects($this->once())->method('filter')->with($options, $qb)->willReturn($qb); |
| 116 | 116 | |
| 117 | - $filters->expects($this->once())->method('get')->with('PaginationQuery/' . $serviceName)->willReturn($filter); |
|
| 117 | + $filters->expects($this->once())->method('get')->with('PaginationQuery/'.$serviceName)->willReturn($filter); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $sm = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
| 121 | 121 | |
| 122 | 122 | $sm->expects($this->exactly(2))->method('get') |
| 123 | - ->withConsecutive([ 'repositories' ], [ 'FilterManager']) |
|
| 123 | + ->withConsecutive(['repositories'], ['FilterManager']) |
|
| 124 | 124 | ->will($this->onConsecutiveCalls($repositories, $filters)); |
| 125 | 125 | |
| 126 | 126 | $target = $this->target; |