|
6 | 6 | use Igorsgm\GitHooks\Git\ChangedFiles; |
7 | 7 |
|
8 | 8 | test('Sends ChangedFiles through HookPipes', function (string $listOfChangedFiles) { |
9 | | -// This approach is broken in the current version of Mockery |
10 | | -// @TODO: Update this test once Pest or Mockery versions are updated |
11 | | -// $preCommitHook1 = mock(PreCommitHook::class)->expect( |
12 | | -// handle: function (ChangedFiles $files, Closure $closure) use ($listOfChangedFiles) { |
13 | | -// $firstChangedFile = (string) $files->getFiles()->first(); |
14 | | -// expect($firstChangedFile)->toBe($listOfChangedFiles); |
15 | | -// } |
16 | | -// ); |
| 9 | + // This approach is broken in the current version of Mockery |
| 10 | + // @TODO: Update this test once Pest or Mockery versions are updated |
| 11 | + // $preCommitHook1 = mock(PreCommitHook::class)->expect( |
| 12 | + // handle: function (ChangedFiles $files, Closure $closure) use ($listOfChangedFiles) { |
| 13 | + // $firstChangedFile = (string) $files->getFiles()->first(); |
| 14 | + // expect($firstChangedFile)->toBe($listOfChangedFiles); |
| 15 | + // } |
| 16 | + // ); |
17 | 17 | $preCommitHook1 = mock(PreCommitHook::class); |
18 | 18 | $preCommitHook1->expects('handle') |
19 | 19 | ->andReturnUsing(function (ChangedFiles $files, Closure $closure) use ($listOfChangedFiles) { |
|
34 | 34 | })->with('listOfChangedFiles'); |
35 | 35 |
|
36 | 36 | it('Returns 1 on HookFailException', function ($listOfChangedFiles) { |
37 | | -// This approach is broken in the current version of Mockery |
38 | | -// @TODO: Update this test once Pest or Mockery versions are updated |
39 | | -// $preCommitHook1 = mock(PreCommitHook::class)->expect( |
40 | | -// handle: function (ChangedFiles $files, Closure $closure) { |
41 | | -// throw new HookFailException(); |
42 | | -// } |
43 | | -// ); |
| 37 | + // This approach is broken in the current version of Mockery |
| 38 | + // @TODO: Update this test once Pest or Mockery versions are updated |
| 39 | + // $preCommitHook1 = mock(PreCommitHook::class)->expect( |
| 40 | + // handle: function (ChangedFiles $files, Closure $closure) { |
| 41 | + // throw new HookFailException(); |
| 42 | + // } |
| 43 | + // ); |
44 | 44 | $preCommitHook1 = mock(PreCommitHook::class); |
45 | 45 | $preCommitHook1->expects('handle') |
46 | 46 | ->andReturnUsing(function (ChangedFiles $files, Closure $closure) { |
47 | 47 | throw new HookFailException(); |
48 | 48 | }); |
49 | 49 |
|
50 | | - |
51 | 50 | $this->config->set('git-hooks.pre-commit', [ |
52 | 51 | $preCommitHook1, |
53 | 52 | ]); |
|
0 commit comments