diff --git a/tests/Feature/BoostServiceProviderTest.php b/tests/Feature/BoostServiceProviderTest.php index c855cc18..61beeef0 100644 --- a/tests/Feature/BoostServiceProviderTest.php +++ b/tests/Feature/BoostServiceProviderTest.php @@ -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(); }); }); diff --git a/tests/Feature/Mcp/ToolExecutorTest.php b/tests/Feature/Mcp/ToolExecutorTest.php index af568d24..172fd7fe 100644 --- a/tests/Feature/Mcp/ToolExecutorTest.php +++ b/tests/Feature/Mcp/ToolExecutorTest.php @@ -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 ?? ''; @@ -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 () { @@ -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(); } diff --git a/tests/Feature/Mcp/ToolRegistryTest.php b/tests/Feature/Mcp/ToolRegistryTest.php index 4ece3c4c..618f8612 100644 --- a/tests/Feature/Mcp/ToolRegistryTest.php +++ b/tests/Feature/Mcp/ToolRegistryTest.php @@ -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 () { diff --git a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php index 1a628d5c..81ae1de3 100644 --- a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php +++ b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php @@ -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 () { diff --git a/tests/Unit/Install/CodeEnvironmentsDetectorTest.php b/tests/Unit/Install/CodeEnvironmentsDetectorTest.php index 5ec57c38..37f64915 100644 --- a/tests/Unit/Install/CodeEnvironmentsDetectorTest.php +++ b/tests/Unit/Install/CodeEnvironmentsDetectorTest.php @@ -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'); diff --git a/tests/Unit/Install/Detection/DirectoryDetectionStrategyTest.php b/tests/Unit/Install/Detection/DirectoryDetectionStrategyTest.php index 9e1ee3ba..cba43233 100644 --- a/tests/Unit/Install/Detection/DirectoryDetectionStrategyTest.php +++ b/tests/Unit/Install/Detection/DirectoryDetectionStrategyTest.php @@ -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 diff --git a/tests/Unit/Install/GuidelineWriterTest.php b/tests/Unit/Install/GuidelineWriterTest.php index 9422c804..d84040d1 100644 --- a/tests/Unit/Install/GuidelineWriterTest.php +++ b/tests/Unit/Install/GuidelineWriterTest.php @@ -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); @@ -238,14 +238,14 @@ $content = file_get_contents($tempFile); // Verify guidelines were replaced in-place - expect($content)->toContain(''); - expect($content)->toContain('updated guidelines from boost'); + expect($content)->toContain('') + ->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\nupdated guidelines from boost\n\n\n# User Added Section\nThis content was added by the user after the guidelines.\n\n## Another user section\nMore content here."); diff --git a/tests/Unit/Install/Mcp/FileWriterTest.php b/tests/Unit/Install/Mcp/FileWriterTest.php index 5d1dc442..d400c46d 100644 --- a/tests/Unit/Install/Mcp/FileWriterTest.php +++ b/tests/Unit/Install/Mcp/FileWriterTest.php @@ -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) {