diff --git a/src/Install/CodeEnvironment/CodeEnvironment.php b/src/Install/CodeEnvironment/CodeEnvironment.php index 88876193..76c5e8ed 100644 --- a/src/Install/CodeEnvironment/CodeEnvironment.php +++ b/src/Install/CodeEnvironment/CodeEnvironment.php @@ -17,9 +17,7 @@ abstract class CodeEnvironment { public bool $useAbsolutePathForMcp = false; - public function __construct(protected readonly DetectionStrategyFactory $strategyFactory) - { - } + public function __construct(protected readonly DetectionStrategyFactory $strategyFactory) {} abstract public function name(): string; @@ -48,7 +46,6 @@ public function getPhpPath(): string public function getArtisanPath(): string { return $this->useAbsolutePathForMcp() ? base_path('artisan') : './artisan'; - } /** @@ -81,7 +78,7 @@ public function detectInProject(string $basePath): bool return $strategy->detect($config); } - public function IsAgent(): bool + public function isAgent(): bool { return $this->agentName() && $this instanceof Agent; } diff --git a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php index 3dc56db8..bd723d8c 100644 --- a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php +++ b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php @@ -134,16 +134,16 @@ public function mcpConfigPath(): string expect($environment->mcpClientName())->toBe('Test Environment'); }); -test('IsAgent returns true when implements Agent interface and has agentName', function () { +test('isAgent returns true when implements Agent interface and has agentName', function () { $agent = new TestAgent($this->strategyFactory); - expect($agent->IsAgent())->toBe(true); + expect($agent->isAgent())->toBe(true); }); -test('IsAgent returns false when does not implement Agent interface', function () { +test('isAgent returns false when does not implement Agent interface', function () { $environment = new TestCodeEnvironment($this->strategyFactory); - expect($environment->IsAgent())->toBe(false); + expect($environment->isAgent())->toBe(false); }); test('isMcpClient returns true when implements McpClient interface and has mcpClientName', function () { @@ -259,8 +259,8 @@ public function mcpConfigPath(): string ->once() ->with(Mockery::on(function ($command) { return str_contains($command, 'install test-key test-command "arg1" "arg2"') && - str_contains($command, '-e ENV1="value1"') && - str_contains($command, '-e ENV2="value2"'); + str_contains($command, '-e ENV1="value1"') && + str_contains($command, '-e ENV2="value2"'); })) ->andReturn($mockResult); @@ -355,7 +355,7 @@ public function mcpConfigPath(): string $config = json_decode($json, true); return isset($config['mcpServers']['test-key']) && - isset($config['mcpServers']['existing']); + isset($config['mcpServers']['existing']); })) ->andReturn(true);