From 00de2dbe32dfb04d17beb0b74e71b0711e65bbd4 Mon Sep 17 00:00:00 2001 From: r-kujawa Date: Wed, 17 Jan 2024 22:41:27 -0600 Subject: [PATCH] Rename `service:stubs` command to `orchestrate:stubs` --- .../{PublishStubs.php => OrchestrateStubs.php} | 4 ++-- src/OrchestrationServiceProvider.php | 4 ++-- .../Commands/PublishStubsCommandTest.php | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) rename src/Console/Commands/{PublishStubs.php => OrchestrateStubs.php} (96%) diff --git a/src/Console/Commands/PublishStubs.php b/src/Console/Commands/OrchestrateStubs.php similarity index 96% rename from src/Console/Commands/PublishStubs.php rename to src/Console/Commands/OrchestrateStubs.php index f99ade9..102d800 100644 --- a/src/Console/Commands/PublishStubs.php +++ b/src/Console/Commands/OrchestrateStubs.php @@ -6,7 +6,7 @@ use Illuminate\Support\Str; use Payavel\Orchestration\Traits\GeneratesFiles; -class PublishStubs extends Command +class OrchestrateStubs extends Command { use GeneratesFiles; @@ -15,7 +15,7 @@ class PublishStubs extends Command * * @var string */ - protected $signature = 'service:stubs + protected $signature = 'orchestrate:stubs {stub? : The stub file} {--service= : The service}'; diff --git a/src/OrchestrationServiceProvider.php b/src/OrchestrationServiceProvider.php index 9005de8..7000160 100644 --- a/src/OrchestrationServiceProvider.php +++ b/src/OrchestrationServiceProvider.php @@ -5,7 +5,7 @@ use Illuminate\Support\ServiceProvider; use Payavel\Orchestration\Console\Commands\OrchestrateService; use Payavel\Orchestration\Console\Commands\OrchestrateProvider; -use Payavel\Orchestration\Console\Commands\PublishStubs; +use Payavel\Orchestration\Console\Commands\OrchestrateStubs; class OrchestrationServiceProvider extends ServiceProvider { @@ -42,7 +42,7 @@ protected function registerCommands() $this->commands([ OrchestrateService::class, OrchestrateProvider::class, - PublishStubs::class, + OrchestrateStubs::class, ]); } diff --git a/tests/Feature/Console/Commands/PublishStubsCommandTest.php b/tests/Feature/Console/Commands/PublishStubsCommandTest.php index 92f1fa9..a7a2637 100644 --- a/tests/Feature/Console/Commands/PublishStubsCommandTest.php +++ b/tests/Feature/Console/Commands/PublishStubsCommandTest.php @@ -2,19 +2,19 @@ namespace Payavel\Orchestration\Tests\Feature\Console\Commands; -use Payavel\Orchestration\Console\Commands\PublishStubs; +use Payavel\Orchestration\Console\Commands\OrchestrateStubs; use Payavel\Orchestration\Tests\TestCase; -class PublishStubsCommandTest extends TestCase +class OrchestrateStubsCommandTest extends TestCase { /** @test */ public function publish_stubs_command_publishes_stubs() { - $this->artisan('service:stubs') + $this->artisan('orchestrate:stubs') ->expectsOutput('Successfully published stubs!') ->assertExitCode(0); - foreach(PublishStubs::$baseStubs as $stub) { + foreach(OrchestrateStubs::$baseStubs as $stub) { $this->assertFileExists(base_path('stubs/orchestration/' . $stub . '.stub')); } } @@ -22,13 +22,13 @@ public function publish_stubs_command_publishes_stubs() /** @test */ public function publish_stubs_command_publishes_stubs_for_service() { - $this->artisan('service:stubs', [ + $this->artisan('orchestrate:stubs', [ '--service' => 'mock', ]) ->expectsOutput('Successfully published stubs!') ->assertExitCode(0); - foreach(PublishStubs::$serviceSpecificStubs as $stub) { + foreach(OrchestrateStubs::$serviceSpecificStubs as $stub) { $this->assertFileExists(base_path('stubs/orchestration/mock/' . $stub . '.stub')); } } @@ -36,8 +36,8 @@ public function publish_stubs_command_publishes_stubs_for_service() /** @test */ public function publish_stubs_command_publishes_single_stub_file() { - $this->artisan('service:stubs', [ - 'stub' => $stub = $this->faker->randomElement(PublishStubs::$baseStubs), + $this->artisan('orchestrate:stubs', [ + 'stub' => $stub = $this->faker->randomElement(OrchestrateStubs::$baseStubs), ]) ->expectsOutput('Successfully published stub!') ->assertExitCode(0); @@ -48,7 +48,7 @@ public function publish_stubs_command_publishes_single_stub_file() /** @test */ public function publish_stubs_command_throws_error_when_single_stub_file_does_not_exist() { - $this->artisan('service:stubs', [ + $this->artisan('orchestrate:stubs', [ 'stub' => 'stub', ]) ->expectsOutput('The stub file you wish to publish is not available.')