- How do I use multi-tester to test Laravel package changes against dependent projects?
- Install it as a dev dependency with `composer require kylekatarnls/multi-tester --dev`, then configure `.multi-tester.yml` to list dependent projects. Run `vendor/bin/multi-tester` to replace your package in their vendor dirs and execute their tests. For Laravel projects, ensure the config includes their test commands (e.g., `php artisan test`).
- Does multi-tester work with Laravel 10+ and other versions?
- Yes, multi-tester is framework-agnostic but works seamlessly with Laravel. It replaces your package in dependent projects’ vendor dirs, so it supports any Laravel version as long as the downstream projects use Composer. Test against specific Laravel versions by specifying version constraints in `.multi-tester.yml`.
- Can I run multi-tester in GitHub Actions or only Travis CI?
- While it auto-detects Travis CI projects via `.travis.yml`, multi-tester works in any CI system. For GitHub Actions, manually define test commands in `.multi-tester.yml` (e.g., `php artisan test`). It’s CI-agnostic—just ensure the environment has Composer and Git access.
- How do I handle private Laravel packages in multi-tester?
- Private packages require Git access. Configure SSH keys in your CI environment or use HTTPS with credentials in `.multi-tester.yml` under `git_auth`. For Laravel, ensure private packages are listed in the config with their correct repository URLs and auth methods.
- Will multi-tester break my Laravel project’s autoloading?
- No, multi-tester preserves Composer’s autoloading. It replaces your package in the vendor dir while keeping other dependencies intact. For Laravel, ensure your `composer.json` has correct `autoload` and `replace` keys. Test with `composer dump-autoload` after setup if issues arise.
- How do I limit multi-tester to specific branches or PRs?
- Use CI conditions (e.g., GitHub Actions’ `if` or Travis’ `branches_only`). In `.multi-tester.yml`, add a `filter` section to restrict projects (e.g., `filter: { branch: main }`). For Laravel, this is useful to avoid running tests on every PR unless targeting high-impact dependencies.
- What if a dependent Laravel project fails due to missing PHP extensions?
- Ensure your CI environment matches the dependent project’s requirements. For Laravel, specify extensions like `pdo_mysql` in your CI config (e.g., GitHub Actions’ `services` or Travis’ `addons`). Multi-tester won’t install extensions—validate the environment first.
- Can multi-tester test multiple Laravel versions at once?
- Yes, configure `.multi-tester.yml` with version constraints (e.g., `require: { laravel/framework: ^9.0 || ^10.0 }`). Multi-tester will test your package against each version’s dependencies. For Laravel, this is critical for backward compatibility, especially if your package supports multiple LTS versions.
- How do I debug multi-tester failures in Laravel projects?
- Use `--verbose` for detailed logs. Check the dependent project’s test output to isolate issues. For Laravel, common causes include missing config files (copy from `vendor` to project root) or Artisan command failures. Run tests locally first with `php artisan test` to replicate the environment.
- Are there alternatives to multi-tester for Laravel package testing?
- For Laravel, consider `phpunit` with custom test suites or `pestphp/pest` for testing. However, multi-tester uniquely handles cross-project testing by swapping vendor packages. Other tools like `roave/security-advisories` focus on security, not integration testing. Multi-tester is ideal for shared Laravel packages with many dependencies.