@@ -27,6 +27,7 @@ public function it_can_cleanup_the_directories_specified_in_the_config_file()
27
27
foreach ($ directories as $ directory => $ config ) {
28
28
foreach (range (1 , $ numberOfDirectories ) as $ ageInMinutes ) {
29
29
$ this ->createFile ("{$ directory }/ {$ ageInMinutes }MinutesOld.txt " , $ ageInMinutes );
30
+ $ this ->createFile ("{$ directory }/. {$ ageInMinutes }MinutesOld.txt " , $ ageInMinutes );
30
31
}
31
32
}
32
33
@@ -36,8 +37,10 @@ public function it_can_cleanup_the_directories_specified_in_the_config_file()
36
37
foreach (range (1 , $ numberOfDirectories ) as $ ageInMinutes ) {
37
38
if ($ ageInMinutes < $ config ['deleteAllOlderThanMinutes ' ]) {
38
39
$ this ->assertFileExists ("{$ directory }/ {$ ageInMinutes }MinutesOld.txt " );
40
+ $ this ->assertFileExists ("{$ directory }/. {$ ageInMinutes }MinutesOld.txt " );
39
41
} else {
40
42
$ this ->assertFileNotExists ("{$ directory }/ {$ ageInMinutes }MinutesOld.txt " );
43
+ $ this ->assertFileNotExists ("{$ directory }/. {$ ageInMinutes }MinutesOld.txt " );
41
44
}
42
45
}
43
46
}
@@ -59,6 +62,7 @@ public function it_can_cleanup_the_directories_specified_in_the_config_file_recu
59
62
foreach (range (1 , $ numberSubOfDirectories + 1 ) as $ level ) {
60
63
foreach (range (1 , $ numberSubOfDirectories ) as $ ageInMinutes ) {
61
64
$ this ->createFile ("{$ path }/ {$ ageInMinutes }MinutesOld.txt " , $ ageInMinutes );
65
+ $ this ->createFile ("{$ path }/. {$ ageInMinutes }MinutesOld.txt " , $ ageInMinutes );
62
66
}
63
67
$ path .= "{$ level }/ " ;
64
68
}
@@ -72,8 +76,10 @@ public function it_can_cleanup_the_directories_specified_in_the_config_file_recu
72
76
foreach (range (1 , $ numberSubOfDirectories ) as $ ageInMinutes ) {
73
77
if ($ ageInMinutes < $ config ['deleteAllOlderThanMinutes ' ]) {
74
78
$ this ->assertFileExists ("{$ path }/ {$ ageInMinutes }MinutesOld.txt " );
79
+ $ this ->assertFileExists ("{$ path }/. {$ ageInMinutes }MinutesOld.txt " );
75
80
} else {
76
81
$ this ->assertFileNotExists ("{$ path }/ {$ ageInMinutes }MinutesOld.txt " );
82
+ $ this ->assertFileNotExists ("{$ path }/. {$ ageInMinutes }MinutesOld.txt " );
77
83
}
78
84
}
79
85
$ path .= "{$ level }/ " ;
@@ -141,13 +147,19 @@ public function it_can_delete_empty_subdirectories()
141
147
$ this ->createFile ("{$ directory }/emptyDir/5MinutesOld.txt " , 5 );
142
148
$ this ->createDirectory ("{$ directory }/notEmptyDir " );
143
149
$ this ->createFile ("{$ directory }/notEmptyDir/1MinutesOld.txt " , 1 );
150
+ $ this ->createDirectory ("{$ directory }/emptyDirWithHiddenFile " );
151
+ $ this ->createFile ("{$ directory }/emptyDirWithHiddenFile/.5MinutesOld.txt " , 5 );
152
+ $ this ->createDirectory ("{$ directory }/notEmptyDirWithHiddenFile " );
153
+ $ this ->createFile ("{$ directory }/notEmptyDirWithHiddenFile/.1MinutesOld.txt " , 1 );
144
154
}
145
155
146
156
$ this ->artisan ('clean:directories ' );
147
157
148
158
foreach ($ directories as $ directory => $ config ) {
149
159
$ this ->assertDirectoryExists ("{$ directory }/notEmptyDir " );
150
160
$ this ->assertDirectoryNotExists ("{$ directory }/emptyDir " );
161
+ $ this ->assertDirectoryExists ("{$ directory }/notEmptyDirWithHiddenFile " );
162
+ $ this ->assertDirectoryNotExists ("{$ directory }/emptyDirWithHiddenFile " );
151
163
}
152
164
}
153
165
0 commit comments