Thanks to visit codestin.com
Credit goes to github.com

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
4 changes: 2 additions & 2 deletions tests/Feature/BoostServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
$provider->register();
$provider->boot(app('router'));

expect(app()->bound(Laravel\Roster\Roster::class))->toBeTrue();
expect(config('logging.channels.browser'))->not->toBeNull();
expect(app()->bound(Laravel\Roster\Roster::class))->toBeTrue()
->and(config('logging.channels.browser'))->not->toBeNull();
});
});

Expand Down
18 changes: 9 additions & 9 deletions tests/Feature/Mcp/ToolExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
expect(false)->toBeTrue("Tool execution failed with error: {$errorText}");
}

expect($result->isError)->toBeFalse();
expect($result->content)->toBeArray();
expect($result->isError)->toBeFalse()
->and($result->content)->toBeArray();

// The content should contain the app name (which should be "Laravel" in testbench)
$textContent = $result->content[0]->text ?? '';
Expand All @@ -48,15 +48,15 @@
$result1 = $executor->execute(Tinker::class, ['code' => 'return getmypid();']);
$result2 = $executor->execute(Tinker::class, ['code' => 'return getmypid();']);

expect($result1->isError)->toBeFalse();
expect($result2->isError)->toBeFalse();
expect($result1->isError)->toBeFalse()
->and($result2->isError)->toBeFalse();

$pid1 = json_decode($result1->content[0]->text, true)['result'];
$pid2 = json_decode($result2->content[0]->text, true)['result'];

expect($pid1)->toBeInt()->not->toBe(getmypid());
expect($pid2)->toBeInt()->not->toBe(getmypid());
expect($pid1)->not()->toBe($pid2);
expect($pid1)->toBeInt()->not->toBe(getmypid())
->and($pid2)->toBeInt()->not->toBe(getmypid())
->and($pid1)->not()->toBe($pid2);
});

test('subprocess sees modified autoloaded code changes', function () {
Expand Down Expand Up @@ -92,8 +92,8 @@
$result2 = $executor->execute(GetConfig::class, ['key' => 'app.name']);
$response2 = json_decode($result2->content[0]->text, true);

expect($result2->isError)->toBeFalse();
expect($response2['value'])->toBe('MODIFIED_BY_TEST'); // Using updated code, not cached
expect($result2->isError)->toBeFalse()
->and($response2['value'])->toBe('MODIFIED_BY_TEST'); // Using updated code, not cached
} finally {
$cleanup();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Mcp/ToolRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
});

test('can check if tool is allowed', function () {
expect(ToolRegistry::isToolAllowed(ApplicationInfo::class))->toBeTrue();
expect(ToolRegistry::isToolAllowed('NonExistentTool'))->toBeFalse();
expect(ToolRegistry::isToolAllowed(ApplicationInfo::class))->toBeTrue()
->and(ToolRegistry::isToolAllowed('NonExistentTool'))->toBeFalse();
});

test('can get tool names', function () {
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ public function mcpConfigPath(): string

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

expect($result)->toBe(true);
expect($capturedPath)->toBe($environment->mcpConfigPath());
expect($capturedContent)->toBe($expectedContent);
expect($result)->toBe(true)
->and($capturedPath)->toBe($environment->mcpConfigPath())
->and($capturedContent)->toBe($expectedContent);
});

test('installFileMcp updates existing config file', function () {
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Install/CodeEnvironmentsDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@

$detected = $this->detector->discoverProjectInstalledCodeEnvironments($tempDir);

expect($detected)->toContain('vscode');
expect($detected)->toContain('cursor');
expect($detected)->toContain('claudecode');
expect(count($detected))->toBeGreaterThanOrEqual(3);
expect($detected)->toContain('vscode')
->and($detected)->toContain('cursor')
->and($detected)->toContain('claudecode')
->and(count($detected))->toBeGreaterThanOrEqual(3);

// Cleanup
rmdir($tempDir.'/.vscode');
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/Install/Detection/DirectoryDetectionStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@
expect($isAbsolutePathMethod->invoke($this->strategy, '/usr/local/bin'))->toBeTrue();

// Windows absolute paths
expect($isAbsolutePathMethod->invoke($this->strategy, 'C:\\Program Files'))->toBeTrue();
expect($isAbsolutePathMethod->invoke($this->strategy, 'D:\\test'))->toBeTrue();
expect($isAbsolutePathMethod->invoke($this->strategy, 'C:\\Program Files'))->toBeTrue()
->and($isAbsolutePathMethod->invoke($this->strategy, 'D:\\test'))->toBeTrue();

// Relative paths
expect($isAbsolutePathMethod->invoke($this->strategy, 'relative/path'))->toBeFalse();
expect($isAbsolutePathMethod->invoke($this->strategy, './relative'))->toBeFalse();
expect($isAbsolutePathMethod->invoke($this->strategy, '../relative'))->toBeFalse();
expect($isAbsolutePathMethod->invoke($this->strategy, 'relative/path'))->toBeFalse()
->and($isAbsolutePathMethod->invoke($this->strategy, './relative'))->toBeFalse()
->and($isAbsolutePathMethod->invoke($this->strategy, '../relative'))->toBeFalse();
});

function removeDirectory(string $dir): void
Expand Down
16 changes: 8 additions & 8 deletions tests/Unit/Install/GuidelineWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
$writer = new GuidelineWriter($agent);
$writer->write('test guidelines');

expect(is_dir(dirname($filePath)))->toBeTrue();
expect(file_exists($filePath))->toBeTrue();
expect(is_dir(dirname($filePath)))->toBeTrue()
->and(file_exists($filePath))->toBeTrue();

// Cleanup
unlink($filePath);
Expand Down Expand Up @@ -238,14 +238,14 @@
$content = file_get_contents($tempFile);

// Verify guidelines were replaced in-place
expect($content)->toContain('<laravel-boost-guidelines>');
expect($content)->toContain('updated guidelines from boost');
expect($content)->toContain('<laravel-boost-guidelines>')
->and($content)->toContain('updated guidelines from boost');

// Verify user content after guidelines is preserved
expect($content)->toContain('# User Added Section');
expect($content)->toContain('This content was added by the user after the guidelines.');
expect($content)->toContain('## Another user section');
expect($content)->toContain('More content here.');
expect($content)->toContain('# User Added Section')
->and($content)->toContain('This content was added by the user after the guidelines.')
->and($content)->toContain('## Another user section')
->and($content)->toContain('More content here.');

// Verify exact structure
expect($content)->toBe("# My Project\n\n<laravel-boost-guidelines>\nupdated guidelines from boost\n</laravel-boost-guidelines>\n\n# User Added Section\nThis content was added by the user after the guidelines.\n\n## Another user section\nMore content here.");
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/Install/Mcp/FileWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@
->addServer('boost', 'php', ['artisan', 'boost:mcp'])
->save();

expect($result)->toBeTrue();
expect($writtenContent)->toContain('"boost"'); // New server added
expect($writtenContent)->toContain('existing-server'); // Existing server preserved
expect($writtenContent)->toContain('// Trailing comma here'); // Comments preserved
expect($writtenContent)->toContain('arg1'); // Existing args preserved
expect($result)->toBeTrue()
->and($writtenContent)->toContain('"boost"') // New server added
->and($writtenContent)->toContain('existing-server') // Existing server preserved
->and($writtenContent)->toContain('// Trailing comma here') // Comments preserved
->and($writtenContent)->toContain('arg1'); // Existing args preserved
});

test('detectIndentation works correctly with various patterns', function (string $content, int $position, int $expected, string $description) {
Expand Down
Loading