Passed
Push — main ( 222c14...83f636 )
by Sebastian
10:37 queued 06:56
created
tests/unit/Runner/Config/CreatorTest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         $runner = new Creator($io, $config);
40 40
         $runner->advanced(true)
41
-               ->run();
41
+                ->run();
42 42
     }
43 43
 
44 44
     /**
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
         $runner = new Creator($io, $config);
64 64
         $runner->extend(true)
65
-               ->advanced(true)
66
-               ->run();
65
+                ->advanced(true)
66
+                ->run();
67 67
 
68 68
         $configFileContentAfter = $configDir->getChild('captainhook.json')->getContent();
69 69
         $this->assertFileExists($configFile);
Please login to merge, or discard this patch.
tests/unit/Runner/Config/EditorTest.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
         $runner = new Editor($io, $config);
40 40
         $runner->setHook('foo')
41
-               ->setChange('EnableHook')
42
-               ->run();
41
+                ->setChange('EnableHook')
42
+                ->run();
43 43
     }
44 44
 
45 45
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         $runner = new Editor($io, $config);
57 57
         $runner->setChange('EnableHook')
58
-               ->run();
58
+                ->run();
59 59
     }
60 60
 
61 61
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         $runner = new Editor($io, $config);
75 75
         $runner->setHook('pre-commit')
76
-               ->run();
76
+                ->run();
77 77
     }
78 78
 
79 79
     /**
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 
92 92
         $runner = new Editor($io, $config);
93 93
         $runner->setChange('InvalidChange')
94
-               ->setHook('pre-commit')
95
-               ->run();
94
+                ->setHook('pre-commit')
95
+                ->run();
96 96
     }
97 97
 
98 98
     /**
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         $runner = new Editor($io, $config);
112 112
         $runner->setChange('EnableHook')
113
-               ->run();
113
+                ->run();
114 114
     }
115 115
 
116 116
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         $runner = new Editor($io, $config);
130 130
         $runner->setHook('pre-commit')
131
-               ->run();
131
+                ->run();
132 132
     }
133 133
 
134 134
     /**
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 
147 147
         $runner = new Editor($io, $config);
148 148
         $runner->setChange('AddAction')
149
-               ->setHook('pre-commit')
150
-               ->run();
149
+                ->setHook('pre-commit')
150
+                ->run();
151 151
     }
152 152
 
153 153
     /**
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 
166 166
         $runner = new Creator($io, $config);
167 167
         $runner->extend(true)
168
-               ->advanced(true)
169
-               ->run();
168
+                ->advanced(true)
169
+                ->run();
170 170
 
171 171
         $this->assertFileExists($configDir->url() . '/captainhook.json');
172 172
     }
Please login to merge, or discard this patch.
tests/unit/Runner/UninstallerTest.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 
149 149
         $runner = new Uninstaller($io, $config, $repo);
150 150
         $runner->setHook('post-merge')
151
-               ->setMoveExistingTo('foo/bar/')
152
-               ->run();
151
+                ->setMoveExistingTo('foo/bar/')
152
+                ->run();
153 153
 
154 154
         $this->assertFileDoesNotExist($fakeRepo->getHookDir() . '/post-merge');
155 155
         $this->assertFileExists($fakeRepo->getRoot() . '/foo/bar/post-merge');
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 
184 184
         $runner = new Uninstaller($io, $config, $repo);
185 185
         $runner->setHook('pre-commit')
186
-               ->setMoveExistingTo('foo')
187
-               ->run();
186
+                ->setMoveExistingTo('foo')
187
+                ->run();
188 188
     }
189 189
 
190 190
     /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 
216 216
         $runner = new Uninstaller($io, $config, $repo);
217 217
         $runner->setHook('pre-commit')
218
-               ->setMoveExistingTo($virtualFs->url() . '/foo/bar')
219
-               ->run();
218
+                ->setMoveExistingTo($virtualFs->url() . '/foo/bar')
219
+                ->run();
220 220
 
221 221
         $this->assertFileDoesNotExist($fakeRepo->getHookDir() . '/pre-commit');
222 222
         $this->assertFileExists($fakeRepo->getRoot() . '/foo/bar/pre-commit');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
         $repo     = new Repository($fakeRepo->getRoot());
167 167
 
168 168
         $config->method('isHookEnabled')->willReturnCallback(
169
-            function (string $hook): bool {
169
+            function(string $hook): bool {
170 170
                 return $hook === 'pre-push';
171 171
             }
172 172
         );
Please login to merge, or discard this patch.
tests/unit/Runner/ConditionTest.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
         $conditionConfig = new Config\Condition(
145 145
             'and',
146 146
             [[
147
-                 'exec' => '\\' . Any::class,
148
-                 'args' => [
149
-                     ['foo.php', 'bar.php']
150
-                 ]
151
-             ], [
152
-                 'exec' => '\\' . Any::class,
153
-                 'args' => [
154
-                     ['foo.php', 'bar.php']
155
-                 ]
156
-             ]]
147
+                    'exec' => '\\' . Any::class,
148
+                    'args' => [
149
+                        ['foo.php', 'bar.php']
150
+                    ]
151
+                ], [
152
+                    'exec' => '\\' . Any::class,
153
+                    'args' => [
154
+                        ['foo.php', 'bar.php']
155
+                    ]
156
+                ]]
157 157
         );
158 158
 
159 159
         $runner = new Condition($io, $repository, $this->createConfigMock(), 'post-checkout');
@@ -175,21 +175,21 @@  discard block
 block discarded – undo
175 175
         $conditionConfig = new Config\Condition(
176 176
             'or',
177 177
             [[
178
-                 'exec' => '\\' . FileStaged\All::class,
179
-                 'args' => [
180
-                     ['foo.php', 'bar.php']
181
-                 ]
182
-             ], [
183
-                 'exec' => '\\' . Any::class,
184
-                 'args' => [
185
-                     ['buz.php', 'bar.php']
186
-                 ]
187
-             ], [
188
-                 'exec' => '\\' . Any::class,
189
-                 'args' => [
190
-                     ['foo.php', 'bar.php']
191
-                 ]
192
-             ]]
178
+                    'exec' => '\\' . FileStaged\All::class,
179
+                    'args' => [
180
+                        ['foo.php', 'bar.php']
181
+                    ]
182
+                ], [
183
+                    'exec' => '\\' . Any::class,
184
+                    'args' => [
185
+                        ['buz.php', 'bar.php']
186
+                    ]
187
+                ], [
188
+                    'exec' => '\\' . Any::class,
189
+                    'args' => [
190
+                        ['foo.php', 'bar.php']
191
+                    ]
192
+                ]]
193 193
         );
194 194
 
195 195
         $runner = new Condition($io, $repository, $this->createConfigMock(), 'post-checkout');
Please login to merge, or discard this patch.
tests/unit/Runner/InstallerTest.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
         $template = $this->createTemplateMock();
120 120
 
121 121
         $template->expects($this->once())
122
-                 ->method('getCode')
123
-                 ->with('pre-commit')
124
-                 ->willReturn('');
122
+                    ->method('getCode')
123
+                    ->with('pre-commit')
124
+                    ->willReturn('');
125 125
 
126 126
         $runner = new Installer($io, $config, $repo, $template);
127 127
         $runner->setHook('pre-commit');
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
         $repo     = new Repository($fakeRepo->getRoot());
157 157
 
158 158
         $template->expects($this->once())
159
-                 ->method('getCode')
160
-                 ->with('pre-commit')
161
-                 ->willReturn('');
159
+                    ->method('getCode')
160
+                    ->with('pre-commit')
161
+                    ->willReturn('');
162 162
 
163 163
         $runner = new Installer($io, $config, $repo, $template);
164 164
         $runner->setHook('pre-commit')
165
-               ->setMoveExistingTo('foo/bar/')
166
-               ->run();
165
+                ->setMoveExistingTo('foo/bar/')
166
+                ->run();
167 167
 
168 168
         $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit');
169 169
         $this->assertFileExists($fakeRepo->getRoot() . '/foo/bar/pre-commit');
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
         $repo     = new Repository($fakeRepo->getRoot());
195 195
 
196 196
         $template->expects($this->once())
197
-                 ->method('getCode')
198
-                 ->with('pre-commit')
199
-                 ->willReturn('');
197
+                    ->method('getCode')
198
+                    ->with('pre-commit')
199
+                    ->willReturn('');
200 200
 
201 201
         $runner = new Installer($io, $config, $repo, $template);
202 202
         $runner->setHook('pre-commit')
203
-               ->setMoveExistingTo('foo/bar/')
204
-               ->run();
203
+                ->setMoveExistingTo('foo/bar/')
204
+                ->run();
205 205
 
206 206
         $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit');
207 207
     }
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 
236 236
         $runner = new Installer($io, $config, $repo, $template);
237 237
         $runner->setHook('pre-commit')
238
-               ->setMoveExistingTo('foo')
239
-               ->run();
238
+                ->setMoveExistingTo('foo')
239
+                ->run();
240 240
     }
241 241
 
242 242
     /**
Please login to merge, or discard this patch.
tests/unit/Hook/Message/Action/RegexTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $io     = new NullIO();
79 79
         $config = new Config(CH_PATH_FILES . '/captainhook.json');
80
-        $repo    = $this->createRepositoryMock();
80
+        $repo = $this->createRepositoryMock();
81 81
         $action = new Config\Action(Regex::class);
82 82
 
83 83
         $standard = new Regex();
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 'error' => 'No match for %s'
120 120
             ]
121 121
         );
122
-        $repo   = $this->createRepositoryMock();
122
+        $repo = $this->createRepositoryMock();
123 123
         $repo->expects($this->once())->method('getCommitMsg')->willReturn(new CommitMessage('Foo bar baz'));
124 124
 
125 125
         $standard = new Regex();
Please login to merge, or discard this patch.
tests/unit/Hook/Branch/Action/EnsureNamingTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $this->createGitInfoOperator('', 'Foo bar baz')
50 50
         );
51 51
 
52
-        $action  = new Config\Action(EnsureNaming::class, ['regex' => '#bar#']);
52
+        $action = new Config\Action(EnsureNaming::class, ['regex' => '#bar#']);
53 53
 
54 54
         $standard = new EnsureNaming();
55 55
         $standard->execute($config, $io, $repo, $action);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $repo->expects($this->once())->method('getInfoOperator')->willReturn(
75 75
             $this->createGitInfoOperator('', 'Foo bar baz')
76 76
         );
77
-        $action  = new Config\Action(
77
+        $action = new Config\Action(
78 78
             EnsureNaming::class,
79 79
             [
80 80
                 'regex'   => '#.*#',
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         $io     = new NullIO();
101 101
         $config = new Config(CH_PATH_FILES . '/captainhook.json');
102
-        $repo    = $this->createRepositoryMock();
102
+        $repo = $this->createRepositoryMock();
103 103
         $action = new Config\Action(EnsureNaming::class);
104 104
 
105 105
         $standard = new EnsureNaming();
Please login to merge, or discard this patch.
tests/unit/Hook/File/Action/IsEmptyTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
         $io     = new NullIO();
104 104
         $config = new Config(CH_PATH_FILES . '/captainhook.json');
105 105
         $action = new Config\Action(IsEmpty::class, ['files' => [
106
-            CH_PATH_FILES . '/doesNotExist.txt',  // pass
106
+            CH_PATH_FILES . '/doesNotExist.txt', // pass
107 107
             CH_PATH_FILES . '/storage/empty.log', // pass
108 108
             CH_PATH_FILES . '/storage/test.json', // fail
109 109
         ]]);
Please login to merge, or discard this patch.
tests/unit/Hook/File/Action/DoesNotContainRegexTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
         $io     = new NullIO();
35 35
         $config = new Config(CH_PATH_FILES . '/captainhook.json');
36
-        $repo    = $this->createRepositoryMock();
36
+        $repo = $this->createRepositoryMock();
37 37
         $action = new Config\Action(DoesNotContainRegex::class);
38 38
 
39 39
         $standard = new DoesNotContainRegex();
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             'regex'          => '#foo#',
106 106
             'fileExtensions' => ''
107 107
         ]);
108
-        $repo   = $this->createRepositoryMock();
108
+        $repo = $this->createRepositoryMock();
109 109
         $repo->method('getIndexOperator')->willReturn(
110 110
             $this->createGitIndexOperator([
111 111
                 CH_PATH_FILES . '/storage/regextest1.txt',
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
             'regex' => '#.#',
155 155
             'fileExtensions' => ['php']
156 156
         ]);
157
-        $index  = $this->createGitIndexOperator([
157
+        $index = $this->createGitIndexOperator([
158 158
             CH_PATH_FILES . '/storage/regextest1.txt'
159 159
         ]);
160
-        $index->method('getStagedFilesOfType')->willReturnCallback(function ($ext) {
160
+        $index->method('getStagedFilesOfType')->willReturnCallback(function($ext) {
161 161
             if ($ext === 'txt') {
162 162
                 return [
163 163
                     CH_PATH_FILES . '/storage/regextest1.txt'
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
             'regex' => '#foo#',
190 190
             'fileExtensions' => ['txt']
191 191
         ]);
192
-        $index  = $this->createGitIndexOperator([
192
+        $index = $this->createGitIndexOperator([
193 193
             CH_PATH_FILES . '/storage/regextest1.txt'
194 194
         ]);
195
-        $index->method('getStagedFilesOfType')->willReturnCallback(function ($ext) {
195
+        $index->method('getStagedFilesOfType')->willReturnCallback(function($ext) {
196 196
             if ($ext === 'txt') {
197 197
                 return [
198 198
                     CH_PATH_FILES . '/storage/regextest1.txt'
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             }
201 201
             return [];
202 202
         });
203
-        $repo   = $this->createRepositoryMock();
203
+        $repo = $this->createRepositoryMock();
204 204
         $repo->method('getIndexOperator')->willReturn($index);
205 205
 
206 206
         $standard = new DoesNotContainRegex();
Please login to merge, or discard this patch.