@@ -55,8 +55,8 @@ |
||
55 | 55 | ); |
56 | 56 | |
57 | 57 | $io = $this->getMockBuilder(DefaultIO::class) |
58 | - ->disableOriginalConstructor() |
|
59 | - ->getMock(); |
|
58 | + ->disableOriginalConstructor() |
|
59 | + ->getMock(); |
|
60 | 60 | $io->expects($this->once())->method('write'); |
61 | 61 | |
62 | 62 | $add->setIO($io); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | null, |
56 | 56 | ['captainhook.json' => file_get_contents(CH_PATH_FILES . '/config/valid.json')] |
57 | 57 | ); |
58 | - $input = new ArrayInput([ |
|
58 | + $input = new ArrayInput([ |
|
59 | 59 | 'hook' => 'pre-push', |
60 | 60 | '--configuration' => $fakeConfig->url() . '/captainhook.json', |
61 | 61 | ]); |
@@ -62,8 +62,8 @@ |
||
62 | 62 | ); |
63 | 63 | |
64 | 64 | $resolver = $this->getMockBuilder(Resolver::class) |
65 | - ->disableOriginalConstructor() |
|
66 | - ->getMock(); |
|
65 | + ->disableOriginalConstructor() |
|
66 | + ->getMock(); |
|
67 | 67 | $resolver->method('isPharRelease')->willReturn(true); |
68 | 68 | |
69 | 69 | $cmd = new PostCommit($resolver); |
@@ -214,7 +214,7 @@ |
||
214 | 214 | false, |
215 | 215 | ['run-path' => '/usr/local/bin/captainhook', 'verbosity' => 'debug'] |
216 | 216 | ); |
217 | - $json = $config->getJsonData(); |
|
217 | + $json = $config->getJsonData(); |
|
218 | 218 | |
219 | 219 | $this->assertIsArray($json); |
220 | 220 | $this->assertIsArray($json['config']); |
@@ -144,16 +144,16 @@ discard block |
||
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 |
||
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'); |
@@ -77,7 +77,7 @@ discard block |
||
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 |
||
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(); |
@@ -49,7 +49,7 @@ discard block |
||
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 |
||
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 |
||
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(); |
@@ -103,7 +103,7 @@ |
||
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 | ]]); |
@@ -33,7 +33,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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(); |