Skip to content

Commit

Permalink
Force directory creation on old Laravels
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Aug 23, 2021
1 parent ce58aae commit 76890ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration/TestCase.php
Expand Up @@ -769,9 +769,16 @@ public function loadConfig()
public function ensureAppExceptionHandlerExists()
{
$stubPath = __DIR__.'/../../tests/stubs/classes/AppExceptionHandler.php';

$filePath = __DIR__.'/../../vendor/orchestra/testbench-core/laravel/app/Exceptions/Handler.php';

$dir = dirname($filePath);

if (!file_exists($filePath)) {
if (!file_exists($dir)) {
mkdir($dir, 0755, true);
}

file_put_contents($filePath, file_get_contents($stubPath));
}
}
Expand Down

0 comments on commit 76890ff

Please sign in to comment.