File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 44namespace LaravelEasyRepository \helpers ;
55
66
7+ use function League \Flysystem \Local \ensureDirectoryExists ;
8+
79class Search
810{
911 /**
@@ -12,6 +14,9 @@ class Search
1214 * @return array [SplFileInfo]
1315 */
1416 static function file ($ folder , $ pattern_array ) {
17+ // check directory exsist
18+ ensureDirectoryExists ($ folder );
19+
1520 $ return = array ();
1621 $ iti = new \RecursiveDirectoryIterator ($ folder );
1722 foreach (new \RecursiveIteratorIterator ($ iti ) as $ file ){
Original file line number Diff line number Diff line change 1+ <?php
2+
3+
4+ namespace LaravelEasyRepository \Tests \Unit ;
5+
6+
7+ use LaravelEasyRepository \Tests \TestCase ;
8+ class FolderTest extends TestCase
9+ {
10+
11+ /**
12+ * @group folder_test
13+ */
14+ public function test_folder_repository ()
15+ {
16+ $ folder_exist = false ;
17+ if (file_exists ($ this ->app ->basePath ()."/ " .config ("easy-repository.repository_directory " ))) {
18+ $ folder_exist = true ;
19+ } else {
20+ $ folder_exist = false ;
21+ }
22+
23+ $ this ->assertEquals (true , $ folder_exist );
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments