Skip to content

Commit 9cfc3ae

Browse files
committed
Fix unlink error if database does not exist yet
1 parent ba6a716 commit 9cfc3ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/TestCase.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ protected function setUp(): void
1212

1313
// There is probably a more sane way to do this
1414
if (!static::$migrated) {
15-
unlink(database_path('database.sqlite'));
15+
if (file_exists(database_path('database.sqlite'))) {
16+
unlink(database_path('database.sqlite'));
17+
}
18+
1619
touch(database_path('database.sqlite'));
1720

1821
foreach(glob(database_path('migrations/*.php')) as $file) {

0 commit comments

Comments
 (0)