From c21ad18cc2009c407c870e704b4aa6255f0bc158 Mon Sep 17 00:00:00 2001 From: Alexander Gaal Date: Sat, 28 Oct 2023 17:01:24 +0200 Subject: [PATCH] rename dto folder to data objects --- src/Commands/MakeDataTransferObjectCommand.php | 2 +- src/Commands/MakeJobCommand.php | 2 +- tests/Commands/MakeActionCommandTest.php | 1 - tests/Commands/MakeCollectionCommandTest.php | 2 -- tests/Commands/MakeDataTransferObjectCommandTest.php | 8 ++++---- tests/Commands/MakeModuleCommandTest.php | 4 ++-- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Commands/MakeDataTransferObjectCommand.php b/src/Commands/MakeDataTransferObjectCommand.php index 3321046..2c346f1 100644 --- a/src/Commands/MakeDataTransferObjectCommand.php +++ b/src/Commands/MakeDataTransferObjectCommand.php @@ -22,6 +22,6 @@ protected function getStub(): string public function getType(): string { - return 'DataTransferObject'; + return 'DataObject'; } } diff --git a/src/Commands/MakeJobCommand.php b/src/Commands/MakeJobCommand.php index 707bd92..298eb68 100644 --- a/src/Commands/MakeJobCommand.php +++ b/src/Commands/MakeJobCommand.php @@ -14,7 +14,7 @@ protected function getStub(): string { return match (true) { $this->option('sync') => 'job.sync.stub', - default => 'job.stub' + default => 'job.stub' }; } diff --git a/tests/Commands/MakeActionCommandTest.php b/tests/Commands/MakeActionCommandTest.php index b224ff3..2febb09 100644 --- a/tests/Commands/MakeActionCommandTest.php +++ b/tests/Commands/MakeActionCommandTest.php @@ -2,7 +2,6 @@ namespace Tests\Commands; -use Illuminate\Testing\PendingCommand; use Tests\TestCase; class MakeActionCommandTest extends TestCase diff --git a/tests/Commands/MakeCollectionCommandTest.php b/tests/Commands/MakeCollectionCommandTest.php index 4198cc1..dd7f673 100644 --- a/tests/Commands/MakeCollectionCommandTest.php +++ b/tests/Commands/MakeCollectionCommandTest.php @@ -25,8 +25,6 @@ public function testCanMakeCollection(): void $this->assertStringNotContainsString('{{ className }}', $contents); } - - public function testCanMakeCollectionUsingForce(): void { $this->artisan('beyond:make:collection User.UserCollection'); diff --git a/tests/Commands/MakeDataTransferObjectCommandTest.php b/tests/Commands/MakeDataTransferObjectCommandTest.php index 4bc4065..163d602 100644 --- a/tests/Commands/MakeDataTransferObjectCommandTest.php +++ b/tests/Commands/MakeDataTransferObjectCommandTest.php @@ -17,7 +17,7 @@ public function testCanMakeDataTransferObject(): void { $this->artisan('beyond:make:data User.UserData'); - $file = beyond_modules_path('User/Domain/DataTransferObjects/UserData.php'); + $file = beyond_modules_path('User/Domain/DataObjects/UserData.php'); $contents = file_get_contents($file); $this->assertFileExists($file); @@ -29,7 +29,7 @@ public function testCanMakeDataTransferObjectUsingForce(): void { $this->artisan('beyond:make:data User.UserData'); - $file = beyond_modules_path('User/Domain/DataTransferObjects/UserData.php'); + $file = beyond_modules_path('User/Domain/DataObjects/UserData.php'); $contents = file_get_contents($file); $this->assertFileExists($file); @@ -45,7 +45,7 @@ public function testCanMakeDataTransferWithAliasObject(): void { $this->artisan('beyond:make:dto User.UserData'); - $file = beyond_modules_path('User/Domain/DataTransferObjects/UserData.php'); + $file = beyond_modules_path('User/Domain/DataObjects/UserData.php'); $contents = file_get_contents($file); $this->assertFileExists($file); @@ -57,7 +57,7 @@ public function testCanMakeDataTransferWithAliasObjectUsingForce(): void { $this->artisan('beyond:make:dto User.UserData'); - $file = beyond_modules_path('User/Domain/DataTransferObjects/UserData.php'); + $file = beyond_modules_path('User/Domain/DataObjects/UserData.php'); $contents = file_get_contents($file); $this->assertFileExists($file); diff --git a/tests/Commands/MakeModuleCommandTest.php b/tests/Commands/MakeModuleCommandTest.php index 2e7e948..6b06888 100644 --- a/tests/Commands/MakeModuleCommandTest.php +++ b/tests/Commands/MakeModuleCommandTest.php @@ -41,7 +41,7 @@ public function testCanMakeFullModule(): void foreach ($files as $file) { match (Str::contains($file, '.')) { - true => $this->assertFileExists($file), + true => $this->assertFileExists($file), false => $this->assertDirectoryExists($file), }; } @@ -55,7 +55,7 @@ public function testCanMakeFullModuleUsingForce(): void foreach ($files as $file) { match (Str::contains($file, '.')) { - true => $this->assertFileExists($file), + true => $this->assertFileExists($file), false => $this->assertDirectoryExists($file), }; }