File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public static function doEmptyDir($path)
20
20
21
21
foreach ($ iterator as $ path ) {
22
22
$ basename = basename ((string )$ path );
23
- if ($ basename === '. ' || $ basename === '.. ' || $ basename === '.gitignore ' ) {
23
+ if ($ basename === '. ' || $ basename === '.. ' || $ basename === '.gitignore ' || $ basename === ' .gitkeep ' ) {
24
24
continue ;
25
25
}
26
26
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ class CleanCest
4
+ {
5
+ public function cleanDoesNotDeleteGitKeepFiles (\CliGuy $ I )
6
+ {
7
+ $ ds = DIRECTORY_SEPARATOR ;
8
+
9
+ $ I ->amInPath ('tests/data/included ' );
10
+ $ I ->executeCommand ('clean ' );
11
+ $ I ->seeInShellOutput ("included {$ ds }_log " );
12
+ $ I ->seeInShellOutput ("included {$ ds }jazz {$ ds }tests/_log " );
13
+ $ I ->seeInShellOutput ("included {$ ds }jazz {$ ds }pianist {$ ds }tests/_log " );
14
+ $ I ->seeInShellOutput ("included {$ ds }shire {$ ds }tests/_log " );
15
+ $ I ->seeInShellOutput ('Done ' );
16
+ $ I ->seeFileFound ("_log/.gitkeep " );
17
+ $ I ->seeFileFound ("jazz {$ ds }tests/_log/.gitkeep " );
18
+ $ I ->seeFileFound ("jazz {$ ds }pianist {$ ds }tests/_log/.gitkeep " );
19
+ $ I ->seeFileFound ("shire {$ ds }tests/_log/.gitkeep " );
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ public function _before()
6
6
{
7
7
$ logDir = codecept_root_dir ('tests/data/included/_log ' );
8
8
\Codeception \Util \FileSystem::doEmptyDir ($ logDir );
9
- file_put_contents ($ logDir . '/.gitkeep ' , '' );
10
9
}
11
10
12
11
/**
You can’t perform that action at this time.
0 commit comments