Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/ClaudeCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/Codex.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/Copilot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/Gemini.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/OpenCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Install/CodeEnvironment/PhpStorm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
47 changes: 47 additions & 0 deletions tests/Unit/Install/CodeEnvironment/ClaudeCodeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\ClaudeCode;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
39 changes: 39 additions & 0 deletions tests/Unit/Install/CodeEnvironment/CodexTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\Codex;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
36 changes: 36 additions & 0 deletions tests/Unit/Install/CodeEnvironment/CopilotTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\Copilot;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
39 changes: 39 additions & 0 deletions tests/Unit/Install/CodeEnvironment/CursorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\Cursor;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
39 changes: 39 additions & 0 deletions tests/Unit/Install/CodeEnvironment/GeminiTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\Gemini;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
51 changes: 51 additions & 0 deletions tests/Unit/Install/CodeEnvironment/OpenCodeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\OpenCode;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});
39 changes: 39 additions & 0 deletions tests/Unit/Install/CodeEnvironment/PhpStormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

namespace Tests\Unit\Install\CodeEnvironment;

use Laravel\Boost\Install\CodeEnvironment\PhpStorm;
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
use Laravel\Boost\Install\Enums\Platform;
use Mockery;

beforeEach(function (): void {
$this->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');
});