Completed
Push — develop ( 928e2a...e40e4d )
by Mathias
28:01 queued 20:22
created
module/Core/test/CoreTest/Factory/LazyControllerFactoryTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     /**
36 36
      * @dataProvider invokeTestProvider
37 37
      */
38
-    public function testInvoke($requestedName,$expectedClass)
38
+    public function testInvoke($requestedName, $expectedClass)
39 39
     {
40 40
         $moduleManager = $this->createMock(ModuleManagerInterface::class);
41 41
         $config = [];
@@ -54,26 +54,26 @@  discard block
 block discarded – undo
54 54
         $container->expects($this->any())
55 55
             ->method('get')
56 56
             ->willReturnMap([
57
-                ['config',$config],
58
-                ['ModuleManager',$moduleManager],
59
-                ['repositories',$repositories],
60
-                ['Core/EventManager',$eventManager]
57
+                ['config', $config],
58
+                ['ModuleManager', $moduleManager],
59
+                ['repositories', $repositories],
60
+                ['Core/EventManager', $eventManager]
61 61
             ])
62 62
         ;
63 63
 
64 64
         $factory = new LazyControllerFactory();
65 65
         $this->assertInstanceOf(
66 66
             $expectedClass,
67
-            $factory($container,$requestedName)
67
+            $factory($container, $requestedName)
68 68
         );
69 69
     }
70 70
 
71 71
     public function invokeTestProvider()
72 72
     {
73 73
         return [
74
-            ['Core/Index',IndexController::class],
75
-            ['Core/File',FileController::class],
76
-            ['Core/Content',ContentController::class],
74
+            ['Core/Index', IndexController::class],
75
+            ['Core/File', FileController::class],
76
+            ['Core/Content', ContentController::class],
77 77
         ];
78 78
     }
79 79
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $this->expectException(ServiceNotCreatedException::class);
85 85
         $this->expectExceptionMessageRegExp('/Can\'t find correct controller class for/');
86 86
         $factory = new LazyControllerFactory();
87
-        $factory($container,'Core/Foo');
87
+        $factory($container, 'Core/Foo');
88 88
     }
89 89
 
90 90
     public function testThrowsWhenCanNotCreateConstructorArgument()
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
         $this->expectException(ServiceNotCreatedException::class);
95 95
         $this->expectExceptionMessageRegExp('/Can\'t create constructor argument/m');
96 96
         $factory = new LazyControllerFactory();
97
-        $factory($container,'Core/Index');
97
+        $factory($container, 'Core/Index');
98 98
     }
99 99
 
100 100
     public function testCanCreate()
101 101
     {
102 102
         $container = $this->createMock(ContainerInterface::class);
103 103
         $factory = new LazyControllerFactory();
104
-        $this->assertFalse($factory->canCreate($container,'Foo\\Bar'));
105
-        $this->assertTrue($factory->canCreate($container,'Foo\\Controller\\Bar'));
104
+        $this->assertFalse($factory->canCreate($container, 'Foo\\Bar'));
105
+        $this->assertTrue($factory->canCreate($container, 'Foo\\Controller\\Bar'));
106 106
     }
107 107
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/Controller/FileControllerFactoryTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,15 +33,15 @@
 block discarded – undo
33 33
         $container->expects($this->exactly(2))
34 34
             ->method('get')
35 35
             ->willReturnMap([
36
-                ['repositories',$repositories],
37
-                ['Core/File/Events',$coreFileEvents]
36
+                ['repositories', $repositories],
37
+                ['Core/File/Events', $coreFileEvents]
38 38
             ])
39 39
         ;
40 40
 
41 41
         $factory = new FileControllerFactory();
42 42
         $this->assertInstanceOf(
43 43
             FileController::class,
44
-            $factory($container,'some-name')
44
+            $factory($container, 'some-name')
45 45
         );
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
Core/test/CoreTest/Factory/Controller/Plugin/SearchFormFactoryTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     protected $target = SearchFormFactory::class;
41 41
 
42
-    protected $inheritance = [ FactoryInterface::class ];
42
+    protected $inheritance = [FactoryInterface::class];
43 43
 
44 44
     public function testCreatesPluginAndInjectsFormElementManager()
45 45
     {
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 			    'count_get' => 1,
54 54
 		    ]]);*/
55 55
 	    $services = $this->getServiceManagerMock();
56
-	    $services->setService('forms',$forms);
56
+	    $services->setService('forms', $forms);
57 57
 	    
58
-        $plugin = $this->target->__invoke($services,'irrelevant');
58
+        $plugin = $this->target->__invoke($services, 'irrelevant');
59 59
 
60 60
         $this->assertInstanceOf('\Core\Controller\Plugin\SearchForm', $plugin);
61 61
         $this->assertAttributeSame($forms, 'formElementManager', $plugin);
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/Controller/AdminControllerFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         $factory = new AdminControllerFactory();
31 31
         $this->assertInstanceOf(
32 32
             AdminController::class,
33
-            $factory($container,'Core/Admin')
33
+            $factory($container, 'Core/Admin')
34 34
         );
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/OptionsAbstractFactoryTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
         ];
55 55
 
56 56
         return [
57
-            [ [], 'testnameone', 'Test/Name.One', false ],
58
-            [ $cfg1, 'testnametwo', 'Test.Name/Two', true ],
59
-            [ $cfg1, 'othername', '', false ],
60
-            [ $cfg1, 'nonexistant', 'Non.Existant', false ],
57
+            [[], 'testnameone', 'Test/Name.One', false],
58
+            [$cfg1, 'testnametwo', 'Test.Name/Two', true],
59
+            [$cfg1, 'othername', '', false],
60
+            [$cfg1, 'nonexistant', 'Non.Existant', false],
61 61
         ];
62 62
     }
63 63
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $services = $this->getServiceLocatorMock($optionsConfig);
79 79
 
80
-        $method = "assert" . ($expected ? 'True' : 'False');
80
+        $method = "assert".($expected ? 'True' : 'False');
81 81
         $this->$method($target->canCreateServiceWithName($services, $name, $requestedName));
82 82
     }
83 83
 
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
         ];
90 90
 
91 91
         return [
92
-            [ [], 'Test/Name.One', false ],
93
-            [ $cfg1, 'Test.Name/Two', true ],
94
-            [ $cfg1, 'othername', true ],
95
-            [ $cfg1, 'Non.Existant', false ],
92
+            [[], 'Test/Name.One', false],
93
+            [$cfg1, 'Test.Name/Two', true],
94
+            [$cfg1, 'othername', true],
95
+            [$cfg1, 'Non.Existant', false],
96 96
         ];
97 97
     }
98 98
 
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
      * @param $requestedName
105 105
      * @param $expected
106 106
      */
107
-    public function testCanCreate($optionsConfig,$requestedName,$expected)
107
+    public function testCanCreate($optionsConfig, $requestedName, $expected)
108 108
     {
109 109
         $target = new OptionsAbstractFactory();
110 110
         $services = $this->getServiceLocatorMock($optionsConfig);
111 111
 
112 112
         $method = "assert".($expected ? 'True' : 'False');
113
-        $this->$method($target->canCreate($services,$requestedName));
113
+        $this->$method($target->canCreate($services, $requestedName));
114 114
     }
115 115
 
116 116
     /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         $services = $this->getServiceLocatorMock([
144 144
             'TestOption' => [
145
-                'class' => __NAMESPACE__ . '\SimpleOptionsMock',
145
+                'class' => __NAMESPACE__.'\SimpleOptionsMock',
146 146
                 'mode' => 'invalid',
147 147
             ]
148 148
         ]);
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
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
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
      */
206 206
     public function testCreateNestedOptionsInstance()
207 207
     {
208
-        $nestedOptionsMockClass = __NAMESPACE__ . '\NestedOptionsMock';
209
-        $simpleOptionsMockClass = __NAMESPACE__ . '\SimpleOptionsMock';
208
+        $nestedOptionsMockClass = __NAMESPACE__.'\NestedOptionsMock';
209
+        $simpleOptionsMockClass = __NAMESPACE__.'\SimpleOptionsMock';
210 210
 
211 211
         $cfg = [
212 212
             'NestedOptions' => [
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
                 'mode' => OptionsAbstractFactory::MODE_NESTED,
215 215
                 'options' => [
216 216
                     'skalar' => 'itsworking',
217
-                    'array' => [ 'its' => 'working' ],
218
-                    'opt1' => [ '__class__' => $simpleOptionsMockClass ],
219
-                    'opt2' => [ '__class__' => $simpleOptionsMockClass, 'two' => 'four' ],
217
+                    'array' => ['its' => 'working'],
218
+                    'opt1' => ['__class__' => $simpleOptionsMockClass],
219
+                    'opt2' => ['__class__' => $simpleOptionsMockClass, 'two' => 'four'],
220 220
                 ],
221 221
             ],
222 222
         ];
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
 
231 231
         $this->assertInstanceOf($nestedOptionsMockClass, $options);
232 232
         $this->assertEquals('itsworking', $options->getSkalar());
233
-        $this->assertEquals([ 'its' => 'working' ], $options->getArray());
233
+        $this->assertEquals(['its' => 'working'], $options->getArray());
234 234
         $this->assertEquals('One', $options->getOpt1()->getOne());
235 235
         $this->assertEquals('four', $options->getOpt2()->getTwo());
236 236
     }
237 237
 
238 238
     protected function getServiceLocatorMock($optionsConfig = [])
239 239
     {
240
-        $optionsConfig = [ 'options' => $optionsConfig ];
240
+        $optionsConfig = ['options' => $optionsConfig];
241 241
         $services = $this->getMockBuilder('Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
242 242
 
243 243
         $services->expects($this->once())->method('get')->with('config')->willReturn($optionsConfig);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 class SimpleOptionsMock extends AbstractOptions
251 251
 {
252 252
     protected $one = "One";
253
-    protected $two= "Two";
253
+    protected $two = "Two";
254 254
 
255 255
     /**
256 256
      * @param string $one
Please login to merge, or discard this patch.
Core/test/CoreTest/Factory/Form/AbstractCustomizableFieldsetFactoryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/Form/Tree/SelectFactoryTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/View/Helper/AjaxUrlFactoryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/View/Helper/SocialButtonsFactoryTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@
 block discarded – undo
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
Please login to merge, or discard this patch.