|
4 | 4 |
|
5 | 5 | use Wtyd\GitHooks\Utils\FileUtils; |
6 | 6 | use Illuminate\Container\Container; |
| 7 | +use Tests\ConsoleTestCase; |
7 | 8 | use Tests\Utils\PhpFileBuilder; |
8 | 9 | use Tests\SystemTestCase; |
9 | 10 |
|
10 | 11 | /** |
11 | 12 | * Before executing this test suite after any changes, you must commit these changes |
12 | 13 | * @group git |
13 | 14 | */ |
14 | | -class FileUtilsTest extends SystemTestCase |
| 15 | +class FileUtilsTest extends ConsoleTestCase |
15 | 16 | { |
16 | 17 | protected static $gitFilesPathTest = __DIR__ . '/../../testsDir/gitTests'; |
17 | 18 |
|
18 | 19 | protected function setUp(): void |
19 | 20 | { |
20 | 21 | $this->deleteDirStructure(); |
21 | 22 |
|
22 | | - $this->hiddenConsoleOutput(); |
23 | | - |
24 | 23 | $this->createDirStructure(); |
25 | 24 | mkdir(self::$gitFilesPathTest); |
26 | 25 |
|
@@ -55,28 +54,28 @@ function it_retrieve_modified_files() |
55 | 54 | } |
56 | 55 |
|
57 | 56 | /** @test */ |
58 | | - // function it_retrieve_an_empty_array_when_there_are_no_modified_files() |
59 | | - // { |
60 | | - // $gitFiles = $this->container->make(FileUtils::class); |
| 57 | + function it_retrieve_an_empty_array_when_there_are_no_modified_files() |
| 58 | + { |
| 59 | + $gitFiles = $this->container->make(FileUtils::class); |
61 | 60 |
|
62 | | - // $modifiedFiles = $gitFiles->getModifiedFiles(); |
| 61 | + $modifiedFiles = $gitFiles->getModifiedFiles(); |
63 | 62 |
|
64 | | - // $this->assertEquals([], $modifiedFiles); |
65 | | - // } |
| 63 | + $this->assertEquals([], $modifiedFiles); |
| 64 | + } |
66 | 65 |
|
67 | | - // /** @test */ |
68 | | - // function it_retrieve_an_empty_array_when_the_modified_files_there_are_no_added_to_the_git_stage() |
69 | | - // { |
70 | | - // $fileBuilder = new PhpFileBuilder('NewFile'); |
| 66 | + /** @test */ |
| 67 | + function it_retrieve_an_empty_array_when_the_modified_files_there_are_no_added_to_the_git_stage() |
| 68 | + { |
| 69 | + $fileBuilder = new PhpFileBuilder('NewFile'); |
71 | 70 |
|
72 | | - // file_put_contents(self::$gitFilesPathTest . '/NewFile.php', $fileBuilder->build()); |
| 71 | + file_put_contents(self::$gitFilesPathTest . '/NewFile.php', $fileBuilder->build()); |
73 | 72 |
|
74 | | - // $gitFiles = $this->container->make(FileUtils::class); |
| 73 | + $gitFiles = $this->container->make(FileUtils::class); |
75 | 74 |
|
76 | | - // $modifiedFiles = $gitFiles->getModifiedFiles(); |
| 75 | + $modifiedFiles = $gitFiles->getModifiedFiles(); |
77 | 76 |
|
78 | | - // $this->assertEquals([], $modifiedFiles); |
79 | | - // } |
| 77 | + $this->assertEquals([], $modifiedFiles); |
| 78 | + } |
80 | 79 |
|
81 | 80 | /** |
82 | 81 | * @param string $path Absolute path. For example: /var/www/html/githooks/tests/NewFile.php |
|
0 commit comments