- How do I test a Laravel package change across all dependent Laravel projects using multi-tester?
- Run `vendor/bin/multi-tester --add` to generate a `.multi-tester.yml` file, then list your Laravel projects under `projects`. Multi-tester will automatically replace your package in each project’s `vendor/` directory with your local version and execute their test suites (PHPUnit, Pest, or artisan test). For Laravel 10/11, specify PHP versions (e.g., `8.1`, `8.2`) in the config to match Laravel’s supported versions.
- Does multi-tester support Laravel’s Pest testing framework?
- Yes, multi-tester defaults to PHPUnit but can override the test command in `.multi-tester.yml`. For Pest, add a custom script like `test: php artisan test --env=testing` under the project’s config. This works seamlessly with Laravel’s Pest integration, including environment-specific testing.
- Can I use multi-tester with private Laravel repositories or GitHub/GitLab private packages?
- Yes, multi-tester supports private repositories. Configure SSH keys or personal access tokens in your CI (Travis/GitHub Actions) and reference private repos in `.multi-tester.yml` with full Git URLs (e.g., `git@github.com:org/laravel-package.git`). For Laravel’s monorepos, ensure your CI has access to all required private packages.
- How do I configure multi-tester to match Laravel’s production-like dependency resolution?
- Use the `install` option in `.multi-tester.yml` to specify `--prefer-dist` (e.g., `install: composer install --prefer-dist`). This mirrors Laravel’s production environment, where dependencies are installed as archives. For Laravel 10/11, also pin PHP versions (e.g., `php: 8.2`) to avoid compatibility issues with Laravel’s PHP version requirements.
- Will multi-tester work with Laravel’s semantic versioning (e.g., ^9.0, ~10.0.0) in dependent projects?
- Yes, multi-tester respects Composer’s version constraints. If a Laravel project depends on `laravel/framework:^9.0`, multi-tester will install the correct version range. For Laravel 11.x, explicitly pin versions (e.g., `laravel/framework:11.0.*`) in `.multi-tester.yml` to avoid conflicts with Laravel’s evolving dependencies.
- How do I integrate multi-tester into GitHub Actions for Laravel CI?
- Add a GitHub Actions workflow (`.github/workflows/multi-tester.yml`) with a step like `vendor/bin/multi-tester --stop-on-failure`. Use a matrix strategy to test across PHP versions (e.g., `8.1`, `8.2`, `8.3`) for Laravel’s multi-version support. For Laravel projects, include `php artisan test` or `./vendor/bin/pest` as the test command in the config.
- What’s the best way to handle failures in multi-tester for Laravel projects?
- Enable `--stop-on-failure` to fail-fast, which is critical for Laravel’s CI pipelines. For visibility, configure GitHub Actions annotations or Slack alerts via CI environment variables. In `.multi-tester.yml`, use `on_failure: notify` to trigger custom scripts (e.g., Laravel’s `php artisan notify:failed-tests`).
- Does multi-tester support testing against multiple Laravel versions (e.g., 9.x, 10.x, 11.x) simultaneously?
- Yes, define separate project entries in `.multi-tester.yml` with version-specific configs (e.g., `laravel/framework:10.0.*` and `laravel/framework:11.0.*`). Use GitHub Actions’ matrix strategy to run tests in parallel for each Laravel version. For Laravel’s backward compatibility, pin minor versions (e.g., `10.0.*`) to avoid unexpected major version upgrades.
- Can I customize the test environment for Laravel projects (e.g., database, cache) in multi-tester?
- Yes, override the `test` command in `.multi-tester.yml` to include Laravel-specific environment setup. For example, use `test: php artisan test --env=testing --db=sqlite_test` to ensure tests run with Laravel’s default testing database. For Pest, add `--parallel` if your Laravel project supports parallel testing.
- What are the alternatives to multi-tester for Laravel package testing, and why choose this one?
- Alternatives include custom Composer scripts or tools like `phpunit --testdox-html`, but they lack Composer-native integration and CI support. Multi-tester is Laravel-optimized: it handles vendor swaps natively, supports Laravel’s test runners (Pest/PHPUnit), and integrates with Travis/GitHub Actions. Its config-driven approach avoids manual `composer.json` hacks, making it ideal for Laravel’s dependency-heavy ecosystem.