diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d8b267a..b157436 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -54,3 +54,45 @@ jobs: - name: Execute tests run: vendor/bin/pest --ci + test-l10: + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + php: [8.1] + laravel: [10.*] + stability: [prefer-stable] + include: + - laravel: 10.* + testbench: 8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + coverage: none + + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: List Installed Dependencies + run: composer show -D + + - name: Execute tests + run: vendor/bin/pest --ci diff --git a/composer.json b/composer.json index e275065..87f2cea 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "usecroft/laravel", - "description": "MCP server for all of your Laravel projects - better AI pair programming, coming soon.. ", + "description": "MCP server for all of your Laravel projects - better AI pair programming", "keywords": [ "laravel", "mcp", @@ -16,8 +16,8 @@ } ], "require": { - "php": "^8.2", - "illuminate/contracts": "^11.0||^12.0", + "php": "^8.1||^8.2", + "illuminate/contracts": "^10.0||^11.0||^12.0", "spatie/laravel-package-tools": "^1.16" }, "require-dev": { @@ -25,9 +25,9 @@ "nunomaduro/collision": "^8.1.1||^7.10.0", "larastan/larastan": "^2.9||^3.0", "orchestra/testbench": "^10.0.0||^9.0.0||^8.22.0", - "pestphp/pest": "^3.0", - "pestphp/pest-plugin-arch": "^3.0", - "pestphp/pest-plugin-laravel": "^3.0", + "pestphp/pest": "^2.0||^3.0", + "pestphp/pest-plugin-arch": "^2.0||^3.0", + "pestphp/pest-plugin-laravel": "^2.0||^3.0", "phpstan/extension-installer": "^1.3||^2.0", "phpstan/phpstan-deprecation-rules": "^1.1||^2.0", "phpstan/phpstan-phpunit": "^1.3||^2.0" diff --git a/tests/ArchTest.php b/tests/ArchTest.php index 87fb64c..0369e01 100644 --- a/tests/ArchTest.php +++ b/tests/ArchTest.php @@ -1,5 +1,7 @@ expect(['dd', 'dump', 'ray']) - ->each->not->toBeUsed(); +if (function_exists('arch')) { + arch('it will not use debugging functions') + ->expect(['dd', 'dump', 'ray']) + ->each->not->toBeUsed(); +} diff --git a/tests/Commands/CroftInstallCursorCommandTest.php b/tests/Commands/CroftInstallCursorCommandTest.php index f3cd663..0ac350e 100644 --- a/tests/Commands/CroftInstallCursorCommandTest.php +++ b/tests/Commands/CroftInstallCursorCommandTest.php @@ -6,9 +6,14 @@ beforeEach(function () { // Clean up created directories and files after each test File::delete(base_path('.cursor/mcp.json')); - - if (file_exists(base_path('.cursor'))) { - rmdir(base_path('.cursor')); + $dir = base_path('.cursor'); + + if (file_exists($dir)) { + if (is_dir($dir)) { + rmdir(base_path('.cursor')); + } else { + unlink($dir); + } } }); diff --git a/tests/Pest.php b/tests/Pest.php index f8be6f9..db12554 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,10 +1,13 @@ in(__DIR__); function getEditorChoices(): array { - return ['cursor' => 'Cursor', 'windsurf' => 'Windsurf', 'phpstorm' => 'PhpStorm (coming soon)']; + $choices = new ChoiceQuestion('Which editor are you using?', ['cursor' => 'Cursor', 'windsurf' => 'Windsurf', 'phpstorm' => 'PhpStorm (coming soon)']); + + return $choices->getAutocompleterValues(); }