Skip to content

Commit 077bfe3

Browse files
committed
Refactor test enforcement logic in InstallCommand
Simplifies the determineTestEnforcement method by removing the minimum test file check and always prompting the user to decide if AI should create tests. Updates collectInstallationPreferences to match the new method signature.
1 parent 71b558f commit 077bfe3

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

src/Console/InstallCommand.php

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ private function discoverEnvironment(): void
118118
private function collectInstallationPreferences(): void
119119
{
120120
$this->selectedBoostFeatures = $this->selectBoostFeatures();
121-
$this->enforceTests = $this->determineTestEnforcement(ask: false);
122121
$this->selectedTargetMcpClient = $this->selectTargetMcpClients();
123122
$this->selectedTargetAgents = $this->selectTargetAgents();
123+
$this->enforceTests = $this->determineTestEnforcement();
124124
}
125125

126126
private function performInstallation(): void
@@ -196,23 +196,13 @@ private function hyperlink(string $label, string $url): string
196196
* won't have the CI setup to make use of them anyway, so we're just wasting their
197197
* tokens/money by enforcing them.
198198
*/
199-
protected function determineTestEnforcement(bool $ask = true): bool
199+
protected function determineTestEnforcement(): bool
200200
{
201-
$hasMinimumTests = Finder::create()
202-
->in(base_path('tests'))
203-
->files()
204-
->name('*.php')
205-
->count() > 6;
206-
207-
if (! $hasMinimumTests && $ask) {
208-
$hasMinimumTests = select(
209-
label: 'Should AI always create tests?',
210-
options: ['Yes', 'No'],
211-
default: 'Yes'
212-
) === 'Yes';
213-
}
214-
215-
return $hasMinimumTests;
201+
return select(
202+
label: 'Should AI always create tests?',
203+
options: ['Yes', 'No'],
204+
default: 'Yes'
205+
) === 'Yes';
216206
}
217207

218208
/**

0 commit comments

Comments
 (0)