Skip to content

Commit 93b4f3b

Browse files
Fix test name
Co-authored-by: Thai Nguyen Hung <[email protected]> Signed-off-by: Pushpak Chhajed <[email protected]>
1 parent 8f7494c commit 93b4f3b

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/Install/GuidelineWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function write(string $guidelines): int
6969
}
7070

7171
// Ensure file content ends with a newline
72-
if (! str_ends_with($newContent, "\n")) {
72+
if (! str_ends_with((string) $newContent, "\n")) {
7373
$newContent .= "\n";
7474
}
7575

tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ public function mcpConfigPath(): string
122122
expect($environment->mcpClientName())->toBe('Test Environment');
123123
});
124124

125-
test('IsAgent returns true when implements Agent interface and has agentName', function (): void {
125+
test('isAgent returns true when implements Agent interface and has agentName', function (): void {
126126
$agent = new TestAgent($this->strategyFactory);
127127

128128
expect($agent->isAgent())->toBe(true);
129129
});
130130

131-
test('IsAgent returns false when does not implement Agent interface', function (): void {
131+
test('isAgent returns false when does not implement Agent interface', function (): void {
132132
$environment = new TestCodeEnvironment($this->strategyFactory);
133133

134134
expect($environment->isAgent())->toBe(false);
@@ -361,7 +361,12 @@ public function mcpConfigPath(): string
361361

362362
File::shouldReceive('put')
363363
->once()
364-
->with(Mockery::capture($capturedPath), Mockery::capture($capturedContent))
364+
->with('.test/mcp.json', Mockery::on(function ($json): bool {
365+
$config = json_decode($json, true);
366+
367+
return isset($config['mcpServers']['test-key']) &&
368+
isset($config['mcpServers']['existing']);
369+
}))
365370
->andReturn(true);
366371

367372
$result = $environment->installMcp('test-key', 'test-command', ['arg1'], ['ENV' => 'value']);

tests/Unit/Install/GuidelineWriterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
unlink($tempFile);
101101
});
102102

103-
test('it avoids adding extra newline if one already exists', function () {
103+
test('it avoids adding extra newline if one already exists', function (): void {
104104
$tempFile = tempnam(sys_get_temp_dir(), 'boost_test_');
105105
$initialContent = "# Header\n\n<laravel-boost-guidelines>\nold guidelines\n</laravel-boost-guidelines>\n\n# Footer\n";
106106
file_put_contents($tempFile, $initialContent);

0 commit comments

Comments
 (0)