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
42 changes: 42 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -16,18 +16,18 @@
}
],
"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": {
"laravel/pint": "^1.14",
"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"
Expand Down
8 changes: 5 additions & 3 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

arch('it will not use debugging functions')
->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();
}
11 changes: 8 additions & 3 deletions tests/Commands/CroftInstallCursorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
});

Expand Down
5 changes: 4 additions & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

use Croft\Tests\TestCase;
use Symfony\Component\Console\Question\ChoiceQuestion;

uses(TestCase::class)->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();
}
Loading