diff --git a/tests/Generator/ControllerMakeTest.php b/tests/Generator/ControllerMakeTest.php index 77b57fc..958e46f 100644 --- a/tests/Generator/ControllerMakeTest.php +++ b/tests/Generator/ControllerMakeTest.php @@ -27,6 +27,7 @@ } expect(file_exists($expectedPath))->toBeFalse(); + expect(file_exists(app_path('Http/Controllers/Controller.php')))->toBeTrue(); Artisan::call("ddd:controller {$domainName}:{$controllerName}"); @@ -209,10 +210,8 @@ // Remove the base controller $baseControllerPath = app_path('Http/Controllers/Controller.php'); - $originalBaseControllerContent = null; if (file_exists($baseControllerPath)) { - $originalBaseControllerContent = file_get_contents($baseControllerPath); unlink($baseControllerPath); } @@ -230,11 +229,6 @@ expect($contents) ->not->toContain("use App\Http\Controllers\Controller;") ->not->toContain('extends Controller'); - - // Restore the base controller - if ($originalBaseControllerContent) { - file_put_contents($baseControllerPath, $originalBaseControllerContent); - } })->with([ 'Invoicing:InvoiceController' => [ 'Invoicing',