@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ], |
| 40 | 40 | '@testCreateServiceInvokesItselfAndResetsCreationOptions' => [ |
| 41 | 41 | 'class' => AbstractCustomizableFieldsetFactory::class, |
| 42 | - 'mock' => [ '__invoke' ] |
|
| 42 | + 'mock' => ['__invoke'] |
|
| 43 | 43 | ], |
| 44 | 44 | '@testInvokationThrowsExceptionIfOptionsNameIsNotSpecified' => [ |
| 45 | 45 | 'class' => ConcreteAbstractCustomizableFieldsetFactoryWithClassName::class |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ], |
| 53 | 53 | ]; |
| 54 | 54 | |
| 55 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 55 | + private $inheritance = [FactoryInterface::class]; |
|
| 56 | 56 | |
| 57 | 57 | public function testCreationOptions() |
| 58 | 58 | { |
@@ -71,8 +71,8 @@ |
||
| 71 | 71 | $this->target->setCreationOptions($options); |
| 72 | 72 | |
| 73 | 73 | $this->target |
| 74 | - ->expects($this->once()) |
|
| 75 | - ->method('__invoke') |
|
| 74 | + ->expects($this->once()) |
|
| 75 | + ->method('__invoke') |
|
| 76 | 76 | ->with($services, SelectFactory::class, $options) |
| 77 | 77 | ->willReturn(true) |
| 78 | 78 | ; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ], |
| 50 | 50 | ]; |
| 51 | 51 | |
| 52 | - private $inheritance = [ FactoryInterface::class]; |
|
| 52 | + private $inheritance = [FactoryInterface::class]; |
|
| 53 | 53 | |
| 54 | 54 | public function testSetCreationOptions() |
| 55 | 55 | { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $services = new ServiceManager(); |
| 68 | 68 | $forms = new FormElementManagerV3Polyfill($services); |
| 69 | 69 | |
| 70 | - $options = [ 'test' => 'work?' ]; |
|
| 70 | + $options = ['test' => 'work?']; |
|
| 71 | 71 | $this->target->setCreationOptions($options); |
| 72 | 72 | |
| 73 | 73 | $this->target |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | public function provideMissingOptions() |
| 85 | 85 | { |
| 86 | 86 | return [ |
| 87 | - [ null ], |
|
| 88 | - [ [] ], |
|
| 89 | - [ ['tree' => ['value' => 'test']] ], |
|
| 90 | - [ ['tree' => ['entity' => 'test']] ], |
|
| 91 | - [ ['tree' => ['name' => 'test']] ], |
|
| 87 | + [null], |
|
| 88 | + [[]], |
|
| 89 | + [['tree' => ['value' => 'test']]], |
|
| 90 | + [['tree' => ['entity' => 'test']]], |
|
| 91 | + [['tree' => ['name' => 'test']]], |
|
| 92 | 92 | ]; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | $this->expectException(\RuntimeException::class); |
| 121 | 121 | $this->expectExceptionMessage('Tree root not found'); |
| 122 | 122 | |
| 123 | - $this->target->__invoke($services, '', ['tree' => [ 'entity' => 'testEntityRepository', 'value' => 'test']]); |
|
| 123 | + $this->target->__invoke($services, '', ['tree' => ['entity' => 'testEntityRepository', 'value' => 'test']]); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - private function getServiceContainer($criteria, $root=null) |
|
| 126 | + private function getServiceContainer($criteria, $root = null) |
|
| 127 | 127 | { |
| 128 | 128 | if (null === $root) { $root = new Node('Test'); } |
| 129 | 129 | $repository = $this |
@@ -184,9 +184,9 @@ discard block |
||
| 184 | 184 | $root3 = $this->createRoot('root', ['child1' => ['gChild11', 'gChild12']]); |
| 185 | 185 | |
| 186 | 186 | return [ |
| 187 | - [ $root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
| 188 | - [ $root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
| 189 | - [ $root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]] ] |
|
| 187 | + [$root1, [], ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]], |
|
| 188 | + [$root2, ['use_root_item' => true], ['root' => ['label' => 'root', 'options' => ['child1' => ['label' => 'child1', 'options' => ['child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]]]], |
|
| 189 | + [$root3, ['allow_select_nodes' => true], ['child1-group' => ['label' => 'child1', 'options' => ['child1' => 'child1', 'child1-gchild11' => 'gChild11', 'child1-gchild12' => 'gChild12']]]] |
|
| 190 | 190 | ]; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | private $target = [ |
| 40 | 40 | AjaxUrlFactory::class, |
| 41 | - '@testCreateService' => [ 'mock' => ['__invoke']], |
|
| 41 | + '@testCreateService' => ['mock' => ['__invoke']], |
|
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 44 | + private $inheritance = [FactoryInterface::class]; |
|
| 45 | 45 | |
| 46 | 46 | public function testCreateService() |
| 47 | 47 | { |
@@ -44,16 +44,16 @@ |
||
| 44 | 44 | $options = new ModuleOptions(); |
| 45 | 45 | $config = ['testwert']; |
| 46 | 46 | |
| 47 | - $HauptServiceLocator = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
|
| 48 | - $HauptServiceLocator->expects($this->exactly(2))->method('get')->withConsecutive(['Auth/Options'],['Config'])->will($this->onConsecutiveCalls($options, $config)); |
|
| 47 | + $HauptServiceLocator = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
|
| 48 | + $HauptServiceLocator->expects($this->exactly(2))->method('get')->withConsecutive(['Auth/Options'], ['Config'])->will($this->onConsecutiveCalls($options, $config)); |
|
| 49 | 49 | |
| 50 | 50 | $target = new SocialButtonsFactory(); |
| 51 | 51 | |
| 52 | - $helper = $target($HauptServiceLocator,'irrelevant'); |
|
| 52 | + $helper = $target($HauptServiceLocator, 'irrelevant'); |
|
| 53 | 53 | |
| 54 | - $this->assertInstanceOf("Core\View\Helper\SocialButtons",$helper); |
|
| 55 | - $this->assertAttributeSame($options,'options',$helper); |
|
| 56 | - $this->assertAttributeEquals($config,'config',$helper); |
|
| 54 | + $this->assertInstanceOf("Core\View\Helper\SocialButtons", $helper); |
|
| 55 | + $this->assertAttributeSame($options, 'options', $helper); |
|
| 56 | + $this->assertAttributeEquals($config, 'config', $helper); |
|
| 57 | 57 | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $plugins = $this->createPluginManagerMock($container, 1); |
| 52 | 52 | |
| 53 | 53 | $this->target |
| 54 | - ->expects($this->once()) |
|
| 55 | - ->method('__invoke') |
|
| 56 | - ->with($container, Snippet::class) |
|
| 54 | + ->expects($this->once()) |
|
| 55 | + ->method('__invoke') |
|
| 56 | + ->with($container, Snippet::class) |
|
| 57 | 57 | ; |
| 58 | 58 | |
| 59 | 59 | $this->target->createService($container); |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $events = new EventManager(); |
| 65 | 65 | $partialHelper = new Partial(); |
| 66 | - $config = ['test' => 'works']; |
|
| 66 | + $config = ['test' => 'works']; |
|
| 67 | 67 | |
| 68 | - $container = $this->createServiceManagerMock([ |
|
| 69 | - 'Config' => ['service' => ['view_helper_config' => ['snippets' => $config]], 'count_get' => 1, 'direct' => true], |
|
| 70 | - 'Core/ViewSnippets/Events' => ['service' => $events, 'count_get' => 1], |
|
| 71 | - //'ViewHelperManager' => ['service' => $helpers, 'count_get' => 1], |
|
| 72 | - ]); |
|
| 68 | + $container = $this->createServiceManagerMock([ |
|
| 69 | + 'Config' => ['service' => ['view_helper_config' => ['snippets' => $config]], 'count_get' => 1, 'direct' => true], |
|
| 70 | + 'Core/ViewSnippets/Events' => ['service' => $events, 'count_get' => 1], |
|
| 71 | + //'ViewHelperManager' => ['service' => $helpers, 'count_get' => 1], |
|
| 72 | + ]); |
|
| 73 | 73 | $helpers = $this->createPluginManagerMock([ |
| 74 | 74 | 'partial' => ['service' => $partialHelper, 'count_get' => 1], |
| 75 | 75 | ],$container); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | '@testCreateService' => ['mock' => ['__invoke']], |
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 45 | + private $inheritance = [FactoryInterface::class]; |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | public function testCreateService() |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | ]); |
| 73 | 73 | $helpers = $this->createPluginManagerMock([ |
| 74 | 74 | 'partial' => ['service' => $partialHelper, 'count_get' => 1], |
| 75 | - ],$container); |
|
| 76 | - $container->setService('ViewHelperManager',$helpers); |
|
| 75 | + ], $container); |
|
| 76 | + $container->setService('ViewHelperManager', $helpers); |
|
| 77 | 77 | |
| 78 | 78 | $instance = $this->target->__invoke($container, Snippet::class); |
| 79 | 79 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | '@testCreateService' => ['mock' => ['__invoke' => ['@with' => 'getInvokationMockArgs', 'count' => 1]]], |
| 40 | 40 | ]; |
| 41 | 41 | |
| 42 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 42 | + private $inheritance = [FactoryInterface::class]; |
|
| 43 | 43 | |
| 44 | 44 | private function getInvokationMockArgs() |
| 45 | 45 | { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $this->fail('Imagine instance creation for ' .$lib . ' failed.'); |
|
| 90 | + $this->fail('Imagine instance creation for '.$lib.' failed.'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | ], |
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | - private $inheritance = [ FactoryInterface::class ]; |
|
| 45 | + private $inheritance = [FactoryInterface::class]; |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * @testdox Method createService() proxies to __invoke() |
@@ -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(); |