diff --git a/src/Install/CodeEnvironment/ClaudeCode.php b/src/Install/CodeEnvironment/ClaudeCode.php index ed7d58dd..0e4cdd4e 100644 --- a/src/Install/CodeEnvironment/ClaudeCode.php +++ b/src/Install/CodeEnvironment/ClaudeCode.php @@ -53,6 +53,6 @@ public function mcpConfigPath(): string public function guidelinesPath(): string { - return 'CLAUDE.md'; + return config('boost.code_environments.claude_code.guidelines_path', 'CLAUDE.md'); } } diff --git a/src/Install/CodeEnvironment/Codex.php b/src/Install/CodeEnvironment/Codex.php index 99d5d6d2..9e07278b 100644 --- a/src/Install/CodeEnvironment/Codex.php +++ b/src/Install/CodeEnvironment/Codex.php @@ -43,7 +43,7 @@ public function projectDetectionConfig(): array public function guidelinesPath(): string { - return 'AGENTS.md'; + return config('boost.code_environments.codex.guidelines_path', 'AGENTS.md'); } public function mcpInstallationStrategy(): McpInstallationStrategy diff --git a/src/Install/CodeEnvironment/Copilot.php b/src/Install/CodeEnvironment/Copilot.php index 2219539e..96bea149 100644 --- a/src/Install/CodeEnvironment/Copilot.php +++ b/src/Install/CodeEnvironment/Copilot.php @@ -46,6 +46,6 @@ public function mcpClientName(): ?string public function guidelinesPath(): string { - return '.github/copilot-instructions.md'; + return config('boost.code_environments.copilot.guidelines_path', '.github/copilot-instructions.md'); } } diff --git a/src/Install/CodeEnvironment/Cursor.php b/src/Install/CodeEnvironment/Cursor.php index 8449a5fc..af87c901 100644 --- a/src/Install/CodeEnvironment/Cursor.php +++ b/src/Install/CodeEnvironment/Cursor.php @@ -56,7 +56,7 @@ public function mcpConfigPath(): string public function guidelinesPath(): string { - return '.cursor/rules/laravel-boost.mdc'; + return config('boost.code_environments.cursor.guidelines_path', '.cursor/rules/laravel-boost.mdc'); } public function frontmatter(): bool diff --git a/src/Install/CodeEnvironment/Gemini.php b/src/Install/CodeEnvironment/Gemini.php index 13e1598b..d128db4b 100644 --- a/src/Install/CodeEnvironment/Gemini.php +++ b/src/Install/CodeEnvironment/Gemini.php @@ -47,6 +47,6 @@ public function mcpConfigPath(): string public function guidelinesPath(): string { - return 'GEMINI.md'; + return config('boost.code_environments.gemini.guidelines_path', 'GEMINI.md'); } } diff --git a/src/Install/CodeEnvironment/OpenCode.php b/src/Install/CodeEnvironment/OpenCode.php index 1609614b..cf54f1d5 100644 --- a/src/Install/CodeEnvironment/OpenCode.php +++ b/src/Install/CodeEnvironment/OpenCode.php @@ -52,7 +52,7 @@ public function mcpConfigPath(): string public function guidelinesPath(): string { - return 'AGENTS.md'; + return config('boost.code_environments.opencode.guidelines_path', 'AGENTS.md'); } public function mcpConfigKey(): string diff --git a/src/Install/CodeEnvironment/PhpStorm.php b/src/Install/CodeEnvironment/PhpStorm.php index 3e495fa0..39d5f882 100644 --- a/src/Install/CodeEnvironment/PhpStorm.php +++ b/src/Install/CodeEnvironment/PhpStorm.php @@ -65,6 +65,6 @@ public function mcpConfigPath(): string public function guidelinesPath(): string { - return '.junie/guidelines.md'; + return config('boost.code_environments.phpstorm.guidelines_path', '.junie/guidelines.md'); } } diff --git a/tests/Unit/Install/CodeEnvironment/ClaudeCodeTest.php b/tests/Unit/Install/CodeEnvironment/ClaudeCodeTest.php new file mode 100644 index 00000000..5de5fdfd --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/ClaudeCodeTest.php @@ -0,0 +1,47 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns command-based detection for all platforms', function (): void { + $claude = new ClaudeCode($this->strategyFactory); + + expect($claude->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('command') + ->and($claude->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('command') + ->and($claude->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('command'); +}); + +test('guidelinesPath returns default CLAUDE.md when no config set', function (): void { + $claude = new ClaudeCode($this->strategyFactory); + + expect($claude->guidelinesPath())->toBe('CLAUDE.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.claude_code.guidelines_path' => '.claude/CLAUDE.md']); + + $claude = new ClaudeCode($this->strategyFactory); + + expect($claude->guidelinesPath())->toBe('.claude/CLAUDE.md'); +}); + +test('guidelinesPath returns a nested custom path from config', function (): void { + config(['boost.code_environments.claude_code.guidelines_path' => 'docs/ai/CLAUDE.md']); + + $claude = new ClaudeCode($this->strategyFactory); + + expect($claude->guidelinesPath())->toBe('docs/ai/CLAUDE.md'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/CodexTest.php b/tests/Unit/Install/CodeEnvironment/CodexTest.php new file mode 100644 index 00000000..9bd18249 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/CodexTest.php @@ -0,0 +1,39 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns command-based detection for all platforms', function (): void { + $codex = new Codex($this->strategyFactory); + + expect($codex->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('command') + ->and($codex->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('command') + ->and($codex->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('command'); +}); + +test('guidelinesPath returns default AGENTS.md when no config set', function (): void { + $codex = new Codex($this->strategyFactory); + + expect($codex->guidelinesPath())->toBe('AGENTS.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.codex.guidelines_path' => 'docs/AGENTS.md']); + + $codex = new Codex($this->strategyFactory); + + expect($codex->guidelinesPath())->toBe('docs/AGENTS.md'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/CopilotTest.php b/tests/Unit/Install/CodeEnvironment/CopilotTest.php new file mode 100644 index 00000000..640f69b7 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/CopilotTest.php @@ -0,0 +1,36 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('detectOnSystem always returns false', function (): void { + $copilot = new Copilot($this->strategyFactory); + + expect($copilot->detectOnSystem(Platform::Darwin))->toBeFalse() + ->and($copilot->detectOnSystem(Platform::Linux))->toBeFalse() + ->and($copilot->detectOnSystem(Platform::Windows))->toBeFalse(); +}); + +test('guidelinesPath returns a default path when no config set', function (): void { + $copilot = new Copilot($this->strategyFactory); + + expect($copilot->guidelinesPath())->toBe('.github/copilot-instructions.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.copilot.guidelines_path' => 'docs/copilot.md']); + + $copilot = new Copilot($this->strategyFactory); + + expect($copilot->guidelinesPath())->toBe('docs/copilot.md'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/CursorTest.php b/tests/Unit/Install/CodeEnvironment/CursorTest.php new file mode 100644 index 00000000..4c7bf4c7 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/CursorTest.php @@ -0,0 +1,39 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns path-based detection for all platforms', function (): void { + $cursor = new Cursor($this->strategyFactory); + + expect($cursor->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('paths') + ->and($cursor->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('paths') + ->and($cursor->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('paths'); +}); + +test('guidelinesPath returns a default path when no config is set', function (): void { + $cursor = new Cursor($this->strategyFactory); + + expect($cursor->guidelinesPath())->toBe('.cursor/rules/laravel-boost.mdc'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.cursor.guidelines_path' => '.cursor/custom-rules.mdc']); + + $cursor = new Cursor($this->strategyFactory); + + expect($cursor->guidelinesPath())->toBe('.cursor/custom-rules.mdc'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/GeminiTest.php b/tests/Unit/Install/CodeEnvironment/GeminiTest.php new file mode 100644 index 00000000..d4438534 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/GeminiTest.php @@ -0,0 +1,39 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns command-based detection for all platforms', function (): void { + $gemini = new Gemini($this->strategyFactory); + + expect($gemini->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('command') + ->and($gemini->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('command') + ->and($gemini->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('command'); +}); + +test('guidelinesPath returns default GEMINI.md when no config set', function (): void { + $gemini = new Gemini($this->strategyFactory); + + expect($gemini->guidelinesPath())->toBe('GEMINI.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.gemini.guidelines_path' => 'docs/GEMINI.md']); + + $gemini = new Gemini($this->strategyFactory); + + expect($gemini->guidelinesPath())->toBe('docs/GEMINI.md'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/OpenCodeTest.php b/tests/Unit/Install/CodeEnvironment/OpenCodeTest.php new file mode 100644 index 00000000..c89a1714 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/OpenCodeTest.php @@ -0,0 +1,51 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns command-based detection for all platforms', function (): void { + $opencode = new OpenCode($this->strategyFactory); + + expect($opencode->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('command') + ->and($opencode->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('command') + ->and($opencode->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('command'); +}); + +test('mcpServerConfig returns correct structure', function (): void { + $opencode = new OpenCode($this->strategyFactory); + + expect($opencode->mcpServerConfig('php', ['artisan', 'boost:mcp'], ['APP_ENV' => 'local'])) + ->toBe([ + 'type' => 'local', + 'enabled' => true, + 'command' => ['php', 'artisan', 'boost:mcp'], + 'environment' => ['APP_ENV' => 'local'], + ]); +}); + +test('guidelinesPath returns default AGENTS.md when no config set', function (): void { + $opencode = new OpenCode($this->strategyFactory); + + expect($opencode->guidelinesPath())->toBe('AGENTS.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.opencode.guidelines_path' => 'docs/AGENTS.md']); + + $opencode = new OpenCode($this->strategyFactory); + + expect($opencode->guidelinesPath())->toBe('docs/AGENTS.md'); +}); diff --git a/tests/Unit/Install/CodeEnvironment/PhpStormTest.php b/tests/Unit/Install/CodeEnvironment/PhpStormTest.php new file mode 100644 index 00000000..c81caad3 --- /dev/null +++ b/tests/Unit/Install/CodeEnvironment/PhpStormTest.php @@ -0,0 +1,39 @@ +strategyFactory = Mockery::mock(DetectionStrategyFactory::class); +}); + +test('systemDetectionConfig returns path-based detection for all platforms', function (): void { + $phpstorm = new PhpStorm($this->strategyFactory); + + expect($phpstorm->systemDetectionConfig(Platform::Darwin)) + ->toHaveKey('paths') + ->and($phpstorm->systemDetectionConfig(Platform::Linux)) + ->toHaveKey('paths') + ->and($phpstorm->systemDetectionConfig(Platform::Windows)) + ->toHaveKey('paths'); +}); + +test('guidelinesPath returns a default path when no config set', function (): void { + $phpstorm = new PhpStorm($this->strategyFactory); + + expect($phpstorm->guidelinesPath())->toBe('.junie/guidelines.md'); +}); + +test('guidelinesPath returns a custom path from config', function (): void { + config(['boost.code_environments.phpstorm.guidelines_path' => '.idea/guidelines.md']); + + $phpstorm = new PhpStorm($this->strategyFactory); + + expect($phpstorm->guidelinesPath())->toBe('.idea/guidelines.md'); +});