diff --git a/.ai/php/8.5/core.blade.php b/.ai/php/8.5/core.blade.php new file mode 100644 index 00000000..312da05f --- /dev/null +++ b/.ai/php/8.5/core.blade.php @@ -0,0 +1,17 @@ +## PHP 8.5 + +- PHP 8.5 has new array functions that will make code simpler whenever we don't use Laravel's collections. + - `array_first(array $array): mixed` - Get first value (or `null` if empty) + - `array_last(array $array): mixed` - Get last value (or `null` if empty) + +- Use `clone($object, ['property' => $value])` to modify properties during cloning—ideal for readonly classes. + +### Pipe Operator +- The pipe operator (`|>`) chains function calls left-to-right, replacing nested calls: + +// Before PHP 8.5 +$slug = strtolower(str_replace(' ', '-', trim($title))); + +// After PHP 8.5 +$slug = $title |> trim(...) |> (fn($s) => str_replace(' ', '-', $s)) |> strtolower(...); + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 135c793a..856497f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,13 @@ jobs: os: [ ubuntu-22.04, windows-latest ] php: [ 8.2, 8.3, 8.4 ] laravel: [ 11, 12 ] + include: + - php: 8.5 + laravel: 12 + os: ubuntu-22.04 + - php: 8.5 + laravel: 12 + os: windows-latest name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index f0a5961d..1df295a1 100644 --- a/composer.json +++ b/composer.json @@ -19,15 +19,15 @@ "illuminate/contracts": "^10.49.0|^11.45.3|^12.28.1", "illuminate/routing": "^10.49.0|^11.45.3|^12.28.1", "illuminate/support": "^10.49.0|^11.45.3|^12.28.1", - "laravel/mcp": "^0.3.4", + "laravel/mcp": "^0.4.0", "laravel/prompts": "0.1.25|^0.3.6", "laravel/roster": "^0.2.9" }, "require-dev": { - "laravel/pint": "1.20", + "laravel/pint": "^1.20.0", "mockery/mockery": "^1.6.12", "orchestra/testbench": "^8.36.0|^9.15.0|^10.6", - "pestphp/pest": "^2.36.0|^3.8.4", + "pestphp/pest": "^2.36.0|^3.8.4|^4.1.5", "phpstan/phpstan": "^2.1.27", "rector/rector": "^2.1" }, diff --git a/src/Mcp/Tools/BrowserLogs.php b/src/Mcp/Tools/BrowserLogs.php index 4b316130..f3ef3d32 100644 --- a/src/Mcp/Tools/BrowserLogs.php +++ b/src/Mcp/Tools/BrowserLogs.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Boost\Concerns\ReadsLogs; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -24,7 +25,7 @@ class BrowserLogs extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/DatabaseQuery.php b/src/Mcp/Tools/DatabaseQuery.php index 1f954037..45c8d663 100644 --- a/src/Mcp/Tools/DatabaseQuery.php +++ b/src/Mcp/Tools/DatabaseQuery.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Illuminate\Support\Facades\DB; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -23,7 +24,7 @@ class DatabaseQuery extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/DatabaseSchema.php b/src/Mcp/Tools/DatabaseSchema.php index 2069f93b..524fcab3 100644 --- a/src/Mcp/Tools/DatabaseSchema.php +++ b/src/Mcp/Tools/DatabaseSchema.php @@ -5,7 +5,8 @@ namespace Laravel\Boost\Mcp\Tools; use Exception; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; @@ -28,7 +29,7 @@ class DatabaseSchema extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/GetAbsoluteUrl.php b/src/Mcp/Tools/GetAbsoluteUrl.php index 300da97d..a22ea282 100644 --- a/src/Mcp/Tools/GetAbsoluteUrl.php +++ b/src/Mcp/Tools/GetAbsoluteUrl.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Mcp\Request; use Laravel\Mcp\Response; use Laravel\Mcp\Server\Tool; @@ -21,7 +22,7 @@ class GetAbsoluteUrl extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/GetConfig.php b/src/Mcp/Tools/GetConfig.php index 1d3d9c9b..31c97700 100644 --- a/src/Mcp/Tools/GetConfig.php +++ b/src/Mcp/Tools/GetConfig.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Illuminate\Support\Facades\Config; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -19,7 +20,7 @@ class GetConfig extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/ListAvailableEnvVars.php b/src/Mcp/Tools/ListAvailableEnvVars.php index 0615eecd..31f86283 100644 --- a/src/Mcp/Tools/ListAvailableEnvVars.php +++ b/src/Mcp/Tools/ListAvailableEnvVars.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Mcp\Request; use Laravel\Mcp\Response; use Laravel\Mcp\Server\Tool; @@ -21,7 +22,7 @@ class ListAvailableEnvVars extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/ListRoutes.php b/src/Mcp/Tools/ListRoutes.php index 77513a8b..08cf0a81 100644 --- a/src/Mcp/Tools/ListRoutes.php +++ b/src/Mcp/Tools/ListRoutes.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Illuminate\Support\Facades\Artisan; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -24,7 +25,7 @@ class ListRoutes extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/ReadLogEntries.php b/src/Mcp/Tools/ReadLogEntries.php index 38e6b946..3c2e234a 100644 --- a/src/Mcp/Tools/ReadLogEntries.php +++ b/src/Mcp/Tools/ReadLogEntries.php @@ -4,7 +4,8 @@ namespace Laravel\Boost\Mcp\Tools; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Boost\Concerns\ReadsLogs; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -24,7 +25,7 @@ class ReadLogEntries extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/ReportFeedback.php b/src/Mcp/Tools/ReportFeedback.php index 6a238e9a..b3c83c9f 100644 --- a/src/Mcp/Tools/ReportFeedback.php +++ b/src/Mcp/Tools/ReportFeedback.php @@ -5,7 +5,8 @@ namespace Laravel\Boost\Mcp\Tools; use Generator; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Boost\Concerns\MakesHttpRequests; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -20,7 +21,7 @@ class ReportFeedback extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/SearchDocs.php b/src/Mcp/Tools/SearchDocs.php index 0ca065a9..23b34407 100644 --- a/src/Mcp/Tools/SearchDocs.php +++ b/src/Mcp/Tools/SearchDocs.php @@ -5,7 +5,8 @@ namespace Laravel\Boost\Mcp\Tools; use Generator; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Boost\Concerns\MakesHttpRequests; use Laravel\Mcp\Request; use Laravel\Mcp\Response; @@ -28,7 +29,7 @@ public function __construct(protected Roster $roster) {} /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/src/Mcp/Tools/Tinker.php b/src/Mcp/Tools/Tinker.php index f90237a7..67b5a024 100644 --- a/src/Mcp/Tools/Tinker.php +++ b/src/Mcp/Tools/Tinker.php @@ -5,7 +5,8 @@ namespace Laravel\Boost\Mcp\Tools; use Exception; -use Illuminate\JsonSchema\JsonSchema; +use Illuminate\Contracts\JsonSchema\JsonSchema; +use Illuminate\JsonSchema\Types\Type; use Laravel\Mcp\Request; use Laravel\Mcp\Response; use Laravel\Mcp\Server\Tool; @@ -21,7 +22,7 @@ class Tinker extends Tool /** * Get the tool's input schema. * - * @return array + * @return array */ public function schema(JsonSchema $schema): array { diff --git a/tests/Feature/Console/InstallCommandMultiselectTest.php b/tests/Feature/Console/InstallCommandMultiselectTest.php index ce6630a7..1d9729d3 100644 --- a/tests/Feature/Console/InstallCommandMultiselectTest.php +++ b/tests/Feature/Console/InstallCommandMultiselectTest.php @@ -78,15 +78,11 @@ ); // Verify we get keys that can be used with in_array checks - expect($result)->toBeArray(); - expect($result)->toHaveCount(3); // All 3 selected (2 default + 1 added) - - // These are the exact checks used in InstallCommand - expect(in_array('mcp_server', $result, true))->toBeTrue(); - expect(in_array('ai_guidelines', $result, true))->toBeTrue(); - expect(in_array('style_guidelines', $result, true))->toBeTrue(); - - // Verify it doesn't contain the display values - expect(in_array('Boost MCP Server', $result, true))->toBeFalse(); - expect(in_array('Package AI Guidelines (i.e. Framework, Inertia, Pest)', $result, true))->toBeFalse(); + expect($result)->toBeArray() + ->and($result)->toHaveCount(3) + ->and($result)->toContain('mcp_server') + ->and($result)->toContain('ai_guidelines') + ->and($result)->toContain('style_guidelines') + ->and($result)->not->toContain('Boost MCP Server') + ->and($result)->not->toContain('Package AI Guidelines (i.e. Framework, Inertia, Pest)'); })->skipOnWindows(); diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index 096f1744..51d1e046 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -313,7 +313,7 @@ $composer = Mockery::mock(GuidelineComposer::class, [$this->roster, $this->herd])->makePartial(); $composer ->shouldReceive('customGuidelinePath') - ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); + ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('Fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); expect($composer->compose()) ->toContain('=== .ai/custom-rule rules ===') @@ -336,7 +336,7 @@ $composer = Mockery::mock(GuidelineComposer::class, [$this->roster, $this->herd])->makePartial(); $composer ->shouldReceive('customGuidelinePath') - ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); + ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('Fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); $guidelines = $composer->compose(); $overrideStringCount = substr_count((string) $guidelines, 'Thanks though, appreciate you'); @@ -442,7 +442,7 @@ $composer = Mockery::mock(GuidelineComposer::class, [$this->roster, $this->herd])->makePartial(); $composer ->shouldReceive('customGuidelinePath') - ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); + ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('Fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); $guidelines = $composer->compose(); @@ -640,7 +640,7 @@ $composer = Mockery::mock(GuidelineComposer::class, [$this->roster, $this->herd])->makePartial(); $composer ->shouldReceive('customGuidelinePath') - ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); + ->andReturnUsing(fn ($path = ''): string => realpath(testDirectory('Fixtures/.ai/guidelines')).'/'.ltrim((string) $path, '/')); $packages = new PackageCollection([ new Package(Packages::LARAVEL, 'laravel/framework', '11.0.0'), diff --git a/tests/Feature/Middleware/InjectBoostTest.php b/tests/Feature/Middleware/InjectBoostTest.php index 797efd14..1623a305 100644 --- a/tests/Feature/Middleware/InjectBoostTest.php +++ b/tests/Feature/Middleware/InjectBoostTest.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse; beforeEach(function (): void { - $this->app['view']->addNamespace('test', __DIR__.'/../../fixtures'); + $this->app['view']->addNamespace('test', __DIR__.'/../../Fixtures'); }); function createMiddlewareResponse($response): SymfonyResponse diff --git a/tests/fixtures/.ai/guidelines/custom-rule.blade.php b/tests/Fixtures/.ai/guidelines/custom-rule.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/custom-rule.blade.php rename to tests/Fixtures/.ai/guidelines/custom-rule.blade.php diff --git a/tests/fixtures/.ai/guidelines/laravel/11/core.blade.php b/tests/Fixtures/.ai/guidelines/laravel/11/core.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/laravel/11/core.blade.php rename to tests/Fixtures/.ai/guidelines/laravel/11/core.blade.php diff --git a/tests/fixtures/.ai/guidelines/project-specific.blade.php b/tests/Fixtures/.ai/guidelines/project-specific.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/project-specific.blade.php rename to tests/Fixtures/.ai/guidelines/project-specific.blade.php diff --git a/tests/fixtures/.ai/guidelines/test-blade-with-assist.blade.php b/tests/Fixtures/.ai/guidelines/test-blade-with-assist.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/test-blade-with-assist.blade.php rename to tests/Fixtures/.ai/guidelines/test-blade-with-assist.blade.php diff --git a/tests/fixtures/.ai/guidelines/test-blade-with-backticks.blade.php b/tests/Fixtures/.ai/guidelines/test-blade-with-backticks.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/test-blade-with-backticks.blade.php rename to tests/Fixtures/.ai/guidelines/test-blade-with-backticks.blade.php diff --git a/tests/fixtures/.ai/guidelines/test-blade-with-php-tags.blade.php b/tests/Fixtures/.ai/guidelines/test-blade-with-php-tags.blade.php similarity index 100% rename from tests/fixtures/.ai/guidelines/test-blade-with-php-tags.blade.php rename to tests/Fixtures/.ai/guidelines/test-blade-with-php-tags.blade.php diff --git a/tests/fixtures/.ai/guidelines/test-markdown.md b/tests/Fixtures/.ai/guidelines/test-markdown.md similarity index 100% rename from tests/fixtures/.ai/guidelines/test-markdown.md rename to tests/Fixtures/.ai/guidelines/test-markdown.md diff --git a/tests/fixtures/injection-test.blade.php b/tests/Fixtures/injection-test.blade.php similarity index 100% rename from tests/fixtures/injection-test.blade.php rename to tests/Fixtures/injection-test.blade.php diff --git a/tests/fixtures/mcp-comments-in-strings.json b/tests/Fixtures/mcp-comments-in-strings.json similarity index 100% rename from tests/fixtures/mcp-comments-in-strings.json rename to tests/Fixtures/mcp-comments-in-strings.json diff --git a/tests/fixtures/mcp-empty-configkey.json5 b/tests/Fixtures/mcp-empty-configkey.json5 similarity index 100% rename from tests/fixtures/mcp-empty-configkey.json5 rename to tests/Fixtures/mcp-empty-configkey.json5 diff --git a/tests/fixtures/mcp-empty.json b/tests/Fixtures/mcp-empty.json similarity index 100% rename from tests/fixtures/mcp-empty.json rename to tests/Fixtures/mcp-empty.json diff --git a/tests/fixtures/mcp-expected.json5 b/tests/Fixtures/mcp-expected.json5 similarity index 100% rename from tests/fixtures/mcp-expected.json5 rename to tests/Fixtures/mcp-expected.json5 diff --git a/tests/fixtures/mcp-no-configkey.json5 b/tests/Fixtures/mcp-no-configkey.json5 similarity index 100% rename from tests/fixtures/mcp-no-configkey.json5 rename to tests/Fixtures/mcp-no-configkey.json5 diff --git a/tests/fixtures/mcp-plain.json b/tests/Fixtures/mcp-plain.json similarity index 100% rename from tests/fixtures/mcp-plain.json rename to tests/Fixtures/mcp-plain.json diff --git a/tests/fixtures/mcp-trailing-comma.json5 b/tests/Fixtures/mcp-trailing-comma.json5 similarity index 100% rename from tests/fixtures/mcp-trailing-comma.json5 rename to tests/Fixtures/mcp-trailing-comma.json5 diff --git a/tests/fixtures/mcp-with-servers.json b/tests/Fixtures/mcp-with-servers.json similarity index 100% rename from tests/fixtures/mcp-with-servers.json rename to tests/Fixtures/mcp-with-servers.json diff --git a/tests/fixtures/mcp.json5 b/tests/Fixtures/mcp.json5 similarity index 100% rename from tests/fixtures/mcp.json5 rename to tests/Fixtures/mcp.json5 diff --git a/tests/Pest.php b/tests/Pest.php index 79ba034a..fc393e45 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -15,6 +15,8 @@ use Laravel\Mcp\Response; +use function Pest\testDirectory; + uses(Tests\TestCase::class)->in('Unit', 'Feature'); expect()->extend('isToolResult', fn () => $this->toBeInstanceOf(Response::class)); @@ -63,7 +65,14 @@ return $this; }); -function fixture(string $name): string +if (! function_exists('fixture')) { + function fixture(string $name): string + { + return testDirectory('Fixtures/'.$name); + } +} + +function fixtureContent(string $name): string { - return file_get_contents(\Pest\testDirectory('fixtures/'.$name)); + return file_get_contents(fixture($name)); } diff --git a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php index 2f8d1fc5..b4a0a5f5 100644 --- a/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php +++ b/tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php @@ -384,7 +384,7 @@ public function mcpConfigPath(): string $vscode = new VSCode($this->strategyFactory); $capturedPath = ''; $capturedContent = ''; - $json5 = fixture('mcp.json5'); + $json5 = fixtureContent('mcp.json5'); File::shouldReceive('exists')->once()->andReturn(true); File::shouldReceive('size')->once()->andReturn(10); @@ -403,7 +403,7 @@ public function mcpConfigPath(): string expect($wasWritten)->toBeTrue() ->and($capturedPath)->toBe($vscode->mcpConfigPath()) - ->and($capturedContent)->toBe(fixture('mcp-expected.json5')); + ->and($capturedContent)->toBe(fixtureContent('mcp-expected.json5')); }); test('getPhpPath uses absolute paths when forceAbsolutePath is true', function (): void { diff --git a/tests/Unit/Install/GuidelineWriterTest.php b/tests/Unit/Install/GuidelineWriterTest.php index 7bbb5d87..7c879849 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() - ->and(file_exists($filePath))->toBeTrue(); + expect(dirname($filePath))->toBeDirectory() + ->and($filePath)->toBeFile(); // Cleanup unlink($filePath); diff --git a/tests/Unit/Install/Mcp/FileWriterTest.php b/tests/Unit/Install/Mcp/FileWriterTest.php index 17405ef2..f83424de 100644 --- a/tests/Unit/Install/Mcp/FileWriterTest.php +++ b/tests/Unit/Install/Mcp/FileWriterTest.php @@ -69,7 +69,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-plain.json'), + content: fixtureContent('mcp-plain.json'), capturedPath: $writtenPath, capturedContent: $writtenContent ); @@ -101,7 +101,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-with-servers.json'), + content: fixtureContent('mcp-with-servers.json'), capturedPath: $writtenPath, capturedContent: $writtenContent ); @@ -129,7 +129,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp.json5'), + content: fixtureContent('mcp.json5'), capturedContent: $writtenContent ); @@ -153,7 +153,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-comments-in-strings.json'), + content: fixtureContent('mcp-comments-in-strings.json'), capturedContent: $writtenContent ); @@ -220,7 +220,7 @@ }); test('fixture mcp-no-configkey.json5 is detected as JSON5 and will use injectNewConfigKey', function (): void { - $content = fixture('mcp-no-configkey.json5'); + $content = fixtureContent('mcp-no-configkey.json5'); $writer = new FileWriter('/tmp/test.json'); $reflection = new ReflectionClass($writer); @@ -241,7 +241,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-no-configkey.json5'), + content: fixtureContent('mcp-no-configkey.json5'), capturedContent: $writtenContent ); @@ -266,7 +266,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp.json5'), + content: fixtureContent('mcp.json5'), capturedContent: $writtenContent ); @@ -296,7 +296,7 @@ File::shouldReceive('ensureDirectoryExists')->once(); File::shouldReceive('exists')->andReturn(true); File::shouldReceive('size')->andReturn(1000); - File::shouldReceive('get')->andReturn(fixture('mcp.json5')); + File::shouldReceive('get')->andReturn(fixtureContent('mcp.json5')); File::shouldReceive('put') ->with( Mockery::capture($capturedPath), @@ -351,7 +351,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-empty-configkey.json5'), + content: fixtureContent('mcp-empty-configkey.json5'), capturedContent: $writtenContent ); @@ -375,7 +375,7 @@ mockFileOperations( fileExists: true, - content: fixture('mcp-trailing-comma.json5'), + content: fixtureContent('mcp-trailing-comma.json5'), capturedContent: $writtenContent );