From 076a1bef2ae68117d092b38d9ee8d6f2fef64172 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 4 Jun 2022 11:02:51 +0200 Subject: [PATCH] Remove pre-check as package is always included --- src/Commands/HydeServeCommand.php | 22 ------------------- .../Feature/Commands/HydeServeCommandTest.php | 12 ---------- 2 files changed, 34 deletions(-) diff --git a/src/Commands/HydeServeCommand.php b/src/Commands/HydeServeCommand.php index 718d35b6..85776ae2 100644 --- a/src/Commands/HydeServeCommand.php +++ b/src/Commands/HydeServeCommand.php @@ -31,12 +31,6 @@ class HydeServeCommand extends Command */ public function handle(): int { - if (! $this->canRunServer()) { - $this->error('Could not start the server.'); - - return 1; - } - $this->line('Starting the server... Press Ctrl+C to stop'); $this->warn('This feature is experimental. Please report any issues on GitHub.'); @@ -51,20 +45,4 @@ public function handle(): int return 0; } - - /** - * Check if the server can be started. - * - * @return bool - */ - protected function canRunServer(): bool - { - if (! file_exists(Hyde::path('vendor/hyde/realtime-compiler/server.php'))) { - $this->warn('The realtime compiler extension is not installed.'); - - return false; - } - - return true; - } } diff --git a/tests/Feature/Commands/HydeServeCommandTest.php b/tests/Feature/Commands/HydeServeCommandTest.php index 56c91dfb..8a022753 100644 --- a/tests/Feature/Commands/HydeServeCommandTest.php +++ b/tests/Feature/Commands/HydeServeCommandTest.php @@ -17,16 +17,4 @@ public function test_hyde_serve_command() ->expectsOutput('This feature is experimental. Please report any issues on GitHub.') ->assertExitCode(0); } - - public function test_hyde_serve_command_exits_when_compiler_is_not_installed() - { - backup(Hyde::path('vendor/hyde/realtime-compiler/server.php')); - unlink(Hyde::path('vendor/hyde/realtime-compiler/server.php')); - - $this->artisan('serve') - ->expectsOutput('Could not start the server.') - ->assertExitCode(1); - - restore(Hyde::path('vendor/hyde/realtime-compiler/server.php')); - } }