Completed
Pull Request — master (#644)
by Carsten
07:49
created
module/Core/test/CoreTest/Options/Exception/MissingOptionExceptionTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     protected $target = [
31 31
         'class' => '\Core\Options\Exception\MissingOptionException',
32
-        'args' => [ 'testOptionKey', 'TestTarget' ]
32
+        'args' => ['testOptionKey', 'TestTarget']
33 33
     ];
34 34
 
35 35
     protected $inheritance = [
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
         $target2 = new MissingOptionException('-', new \stdClass());
45 45
 
46 46
         return [
47
-            [ 'OptionKey', [
47
+            ['OptionKey', [
48 48
                 'value' => 'testOptionKey',
49 49
                 'ignore_setter' => true,
50 50
             ]],
51
-            [ 'target', [
51
+            ['target', [
52 52
                 'value' => 'TestTarget',
53 53
                 'ignore_setter' => true,
54 54
             ]],
55
-            [ 'targetFQCN', [
55
+            ['targetFQCN', [
56 56
                 'value' => 'stdClass',
57 57
                 'target' => $target2,
58 58
                 'ignore_setter' => true,
59 59
             ]],
60
-            [ 'targetFQCN', [
60
+            ['targetFQCN', [
61 61
                 'value' => 'TestTarget',
62 62
                 'ignore_setter' => true,
63 63
             ]],
64
-            [ 'previous', [
64
+            ['previous', [
65 65
                 'value' => $ex,
66 66
                 'target' => $target,
67 67
                 'ignore_setter' => true,
68 68
             ]],
69
-            [ 'message', [
69
+            ['message', [
70 70
                 'value' => 'Missing value for option "testOptionKey" in "TestTarget"',
71 71
                 'ignore_setter' => true,
72 72
             ]]
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Hydrator/TreeHydratorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private $target = TreeHydrator::class;
35 35
 
36
-    private $inheritance = [ HydratorInterface::class ];
36
+    private $inheritance = [HydratorInterface::class];
37 37
 
38 38
     private function getHydratedTree($mode = 'all')
39 39
     {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function getExtractedTree()
66 66
     {
67
-        return [ 'items' => [
67
+        return ['items' => [
68 68
             new \ArrayObject([
69 69
                 'id' => 'root-id',
70 70
                 'current' => '1',
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Hydrator/MetaDataHydratorTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $expect = ['extract' => 'works'];
51 51
         $object = $this->getMockBuilder(MetaDataProviderInterface::class)
52
-                       ->setMethods(['getMetaData'])
53
-                       ->getMockForAbstractClass();
52
+                        ->setMethods(['getMetaData'])
53
+                        ->getMockForAbstractClass();
54 54
 
55 55
         $object->expects($this->once())->method('getMetaData')->willReturn($expect);
56 56
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
     public function testHydrationOfMetaDataProvider()
70 70
     {
71 71
         $object = $this->getMockBuilder(MetaDataProviderInterface::class)
72
-                       ->setMethods(['setMetaData'])
73
-                       ->getMockForAbstractClass();
72
+                        ->setMethods(['setMetaData'])
73
+                        ->getMockForAbstractClass();
74 74
 
75 75
         $object->expects($this->once())->method('setMetaData')->with('key', 'value');
76 76
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     private $target = MetaDataHydrator::class;
37 37
 
38
-    private $inheritance = [ HydratorInterface::class ];
38
+    private $inheritance = [HydratorInterface::class];
39 39
 
40 40
     public function testExtractionOfNonMetaDataProvider()
41 41
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/WizardContainerTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $labeldContainer->setLabel('testLabel');
43 43
         $topContainer = new Container();
44 44
         $topContainer->setForm('child', [ '__instance__' => $object ])
45
-                     ->setLabel('top');
45
+                        ->setLabel('top');
46 46
 
47 47
         return [
48 48
             /*[ 'Headscripts', [
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $labeldContainer = new Container();
42 42
         $labeldContainer->setLabel('testLabel');
43 43
         $topContainer = new Container();
44
-        $topContainer->setForm('child', [ '__instance__' => $object ])
44
+        $topContainer->setForm('child', ['__instance__' => $object])
45 45
                      ->setLabel('top');
46 46
 
47 47
         return [
@@ -49,85 +49,85 @@  discard block
 block discarded – undo
49 49
                 'default' => [ '/assets/twitter-bootstrap-wizard/jquery.bootstrap.wizard.js' ],
50 50
                 'value'   => [ 'test/scripts' ],
51 51
             ]],*/
52
-            [ 'Form', [
52
+            ['Form', [
53 53
                 'value' => 'test',
54
-                'setter_args' => [ $object ],
55
-                'setter_exception' => [ '\InvalidArgumentException', 'Tab container must be of the type' ],
54
+                'setter_args' => [$object],
55
+                'setter_exception' => ['\InvalidArgumentException', 'Tab container must be of the type'],
56 56
             ]],
57
-            [ 'Form', [
57
+            ['Form', [
58 58
                 'value' => 'test',
59
-                'setter_args' => [ $container ],
60
-                'setter_exception' => [ '\InvalidArgumentException', 'Container instances must have a label' ],
59
+                'setter_args' => [$container],
60
+                'setter_exception' => ['\InvalidArgumentException', 'Container instances must have a label'],
61 61
             ]],
62
-            [ 'Form', [
62
+            ['Form', [
63 63
                 'value' => 'test',
64
-                'setter_args' => [ $labeldContainer ],
65
-                'getter_args' => [ 'test', true ],
64
+                'setter_args' => [$labeldContainer],
65
+                'getter_args' => ['test', true],
66 66
                 'expect' => $labeldContainer,
67 67
             ]],
68
-            [ 'Form', [
68
+            ['Form', [
69 69
                 'value' => 'test',
70
-                'setter_args' => [ 'Test/Container' ],
71
-                'getter_args' => [ 'test', /*asInstance*/ false ],
70
+                'setter_args' => ['Test/Container'],
71
+                'getter_args' => ['test', /*asInstance*/ false],
72 72
                 'expect' => [
73 73
                     'type' => 'Test/Container',
74 74
                     'name' => 'test',
75 75
                     'entity' => '*',
76 76
                 ],
77 77
             ]],
78
-            [ 'Form', [
78
+            ['Form', [
79 79
                 'value' => 'test',
80
-                'setter_args' => [ [ 'type' => 'Test/Container' ] ],
81
-                'getter_args' => [ 'test', false ],
80
+                'setter_args' => [['type' => 'Test/Container']],
81
+                'getter_args' => ['test', false],
82 82
                 'expect' => [
83 83
                     'type' => 'Test/Container',
84 84
                     'name' => 'test',
85 85
                     'entity' => '*',
86 86
                 ],
87 87
             ]],
88
-            [ 'Form', [
88
+            ['Form', [
89 89
                 'value' => 'test',
90
-                'setter_args' => [ [ ] ],
91
-                'getter_args' => [ 'test', false ],
90
+                'setter_args' => [[]],
91
+                'getter_args' => ['test', false],
92 92
                 'expect' => [
93 93
                     'type' => 'Core/Container',
94 94
                     'name' => 'test',
95 95
                     'entity' => '*',
96 96
                 ],
97 97
             ]],
98
-            [ 'Form', [
98
+            ['Form', [
99 99
                 'value' => 'test',
100
-                'setter_args' => [ [ 'forms' => [] ] ],
101
-                'getter_args' => [ 'test', false ],
100
+                'setter_args' => [['forms' => []]],
101
+                'getter_args' => ['test', false],
102 102
                 'expect' => [
103 103
                     'type' => 'Core/Container',
104 104
                     'name' => 'test',
105
-                    'options' => [ 'forms' => [] ],
105
+                    'options' => ['forms' => []],
106 106
                     'entity' => '*',
107 107
                 ]
108 108
             ]],
109
-            [ 'Form', [
109
+            ['Form', [
110 110
                 'value' => 'test',
111
-                'setter_args' => [ [ '__instance__' => $object ] ],
112
-                'getter_args' => [ 'test' ],
111
+                'setter_args' => [['__instance__' => $object]],
112
+                'getter_args' => ['test'],
113 113
                 'getter_exception' => '\UnexpectedValueException'
114 114
             ]],
115
-            [ 'Form', [
115
+            ['Form', [
116 116
                 'value' => 'test',
117
-                'setter_args' => [ [ '__instance__' => $container ] ],
118
-                'getter_args' => [ 'test' ],
117
+                'setter_args' => [['__instance__' => $container]],
118
+                'getter_args' => ['test'],
119 119
                 'getter_exception' => '\UnexpectedValueException'
120 120
             ]],
121
-            [ 'Form', [
121
+            ['Form', [
122 122
                 'value' => 'test',
123
-                'setter_args' => [ [ '__instance__' => $labeldContainer ] ],
124
-                'getter_args' => [ 'test' ],
123
+                'setter_args' => [['__instance__' => $labeldContainer]],
124
+                'getter_args' => ['test'],
125 125
                 'expect' => $labeldContainer
126 126
             ]],
127
-            [ 'Form', [
127
+            ['Form', [
128 128
                 'value' => 'test',
129
-                'setter_args' => [ [ '__instance__' => $topContainer ] ],
130
-                'getter_args' => [ 'test.child' ],
129
+                'setter_args' => [['__instance__' => $topContainer]],
130
+                'getter_args' => ['test.child'],
131 131
                 'expect' => $object
132 132
             ]],
133 133
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/CustomizableFieldsetTraitTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
             [
107 107
                 [
108 108
                     0 => ['name' => 'test', 'options' => ['opt' => 'value', 'label' => 'Overridden']],
109
-                    1 => [ 't' => 'y', 'test' => 'AlsoOverridden']
109
+                    1 => ['t' => 'y', 'test' => 'AlsoOverridden']
110 110
                 ]
111 111
             ],
112 112
             $this->target->addCalledWithArgs
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 
147 147
         $this->assertEquals(
148 148
             ['test' => ['required' => true],
149
-              'test2' => ['filters' => []]],
149
+                'test2' => ['filters' => []]],
150 150
             $actual
151 151
         );
152 152
     }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Tree/ManagementFormTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@
 block discarded – undo
32 32
 
33 33
     private $target = ManagementForm::class;
34 34
 
35
-    private $inheritance = [ SummaryForm::class, HeadscriptProviderInterface::class ];
35
+    private $inheritance = [SummaryForm::class, HeadscriptProviderInterface::class];
36 36
 
37 37
     private $attributes = [
38 38
         'baseFieldset' => 'Core/Tree/ManagementFieldset',
39
-        'attributes'   => [ 'method' => 'POST', 'class' => 'yk-tree-management-form' ],
39
+        'attributes'   => ['method' => 'POST', 'class' => 'yk-tree-management-form'],
40 40
     ];
41 41
 
42 42
     private $properties = [
43
-        [ 'headscripts', ['value' => ['testHeadScript'], 'default' => [ 'modules/Core/js/html.sortable.min.js', 'modules/Core/js/forms.tree-management.js' ]] ]
43
+        ['headscripts', ['value' => ['testHeadScript'], 'default' => ['modules/Core/js/html.sortable.min.js', 'modules/Core/js/forms.tree-management.js']]]
44 44
     ];
45 45
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Tree/ManagementFieldsetTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@
 block discarded – undo
40 40
      */
41 41
     private $target = [
42 42
         ManagementFieldset::class,
43
-        '@testInitialize' => [ 'mock' => ['add'] ],
43
+        '@testInitialize' => ['mock' => ['add']],
44 44
     ];
45 45
 
46
-    private $inheritance = [ Fieldset::class, ViewPartialProviderInterface::class ];
46
+    private $inheritance = [Fieldset::class, ViewPartialProviderInterface::class];
47 47
 
48
-    private $traits = [ ViewPartialProviderTrait::class ];
48
+    private $traits = [ViewPartialProviderTrait::class];
49 49
 
50 50
     private $attributes = [
51 51
         'defaultPartial' => 'core/form/tree-manage',
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Tree/SelectTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     private $target = Select::class;
34 34
 
35
-    private $inheritance = [ ZfSelect::class, HydratorStrategyProviderInterface::class ];
35
+    private $inheritance = [ZfSelect::class, HydratorStrategyProviderInterface::class];
36 36
 
37
-    private $traits = [ HydratorStrategyProviderTrait::class ];
37
+    private $traits = [HydratorStrategyProviderTrait::class];
38 38
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Form/Tree/AddItemFieldsetTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         '@testInitializesItself' => 'setupMock'
38 38
     ];
39 39
 
40
-    private $inheritance = [ Fieldset::class, ViewPartialProviderInterface::class, InputFilterProviderInterface::class];
40
+    private $inheritance = [Fieldset::class, ViewPartialProviderInterface::class, InputFilterProviderInterface::class];
41 41
 
42 42
     private $traits = [ViewPartialProviderTrait::class];
43 43
 
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
             'name' => [
78 78
                 'required' => true,
79 79
                 'filters' => [
80
-                    [ 'name' => 'StringTrim' ],
80
+                    ['name' => 'StringTrim'],
81 81
                 ],
82 82
             ],
83 83
             'value' => [
84 84
                 'required' => false,
85 85
                 'filters' => [
86
-                    [ 'name' => 'StringTrim' ],
86
+                    ['name' => 'StringTrim'],
87 87
                 ],
88 88
             ],
89 89
         ];
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,19 +51,19 @@
 block discarded – undo
51 51
     {
52 52
         $mock = $this->getMockBuilder(AddItemFieldset::class)
53 53
             ->setMethods(['setObject', 'add'])
54
-             ->disableOriginalConstructor()->getMock();
54
+                ->disableOriginalConstructor()->getMock();
55 55
 
56 56
         $mock->expects($this->once())->method('setObject')->with($this->isInstanceOf(\ArrayObject::class));
57 57
 
58 58
         $mock->expects($this->exactly(6))->method('add')
59
-             ->withConsecutive(
60
-                 [['name' => 'id', 'type' => 'Hidden']],
61
-                 [['name' => 'current', 'type' => 'Hidden']],
62
-                 [['name' => 'do', 'type' => 'Hidden']],
63
-                 [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]],
64
-                 [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]],
65
-                 [['name' => 'priority', 'type' => 'Text']]
66
-             );
59
+                ->withConsecutive(
60
+                    [['name' => 'id', 'type' => 'Hidden']],
61
+                    [['name' => 'current', 'type' => 'Hidden']],
62
+                    [['name' => 'do', 'type' => 'Hidden']],
63
+                    [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]],
64
+                    [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]],
65
+                    [['name' => 'priority', 'type' => 'Text']]
66
+                );
67 67
 
68 68
         return $mock;
69 69
     }
Please login to merge, or discard this patch.