From 6b1582ebb23ac096665b7b077cc70fc264fefcea Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Fri, 22 Nov 2024 21:37:28 -0500 Subject: [PATCH] Expect app base controller file to exist. --- tests/Generator/ControllerMakeTest.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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',