- Can Scrutineer replace Laravel’s built-in testing tools like PHPUnit or Pest for manual acceptance testing?
- Scrutineer isn’t a direct replacement for PHPUnit or Pest, which focus on automated unit/feature tests. It’s designed for manual, contract-driven validation—ideal for QA sign-offs or exploratory testing where human judgment is needed. Use it alongside Laravel’s existing tools for a hybrid workflow.
- How do I install Scrutineer in a Laravel project?
- Run `composer require codeheures-fr/scrutineer` to install it. Since it’s Symfony-focused, you’ll need to manually bind its services to Laravel’s container via a custom Service Provider. Check the Symfony docs for console command setup, then adapt them for Artisan.
- Does Scrutineer support Laravel’s Eloquent ORM or database testing?
- Scrutineer works with PDO/Doctrine DBAL by default, so Eloquent queries would need a repository pattern or query builder adapter. For database state validation, you’d likely need custom contracts or extensions to integrate with Laravel’s database testing helpers.
- Will Scrutineer work with Laravel 10 and PHP 8.2+?
- Scrutineer supports PHP 8.x, which aligns with Laravel 10. However, since it’s Symfony-centric, you may encounter minor compatibility quirks (e.g., dependency conflicts). Test thoroughly, especially if using Laravel’s newer features like improved dependency injection.
- Can I integrate Scrutineer with Laravel’s task scheduling (e.g., `schedule:run`)?
- Yes, you can trigger Scrutineer’s console commands via Laravel’s scheduler by defining them in `app/Console/Kernel.php`. However, manual acceptance tests may not fit well in automated schedules—consider using it for on-demand validation instead.
- How do I bind Scrutineer’s services to Laravel’s service container?
- Create a custom Service Provider (e.g., `ScrutineerServiceProvider`) and register bindings in the `register()` method. Use Laravel’s `bind()` or `singleton()` methods to map Scrutineer’s interfaces to concrete implementations, then register the provider in `config/app.php`.
- Does Scrutineer support Laravel’s HTTP layer (API/route testing) or only backend logic?
- Scrutineer’s core is backend-focused, so HTTP testing (e.g., API routes) would require custom contracts or extensions. For Laravel, you’d likely need to pair it with tools like Dusk or Pest for full HTTP validation, using Scrutineer for manual backend checks.
- Are there performance concerns running Scrutineer in a Laravel production environment?
- Scrutineer is console-based, so it won’t impact production performance like HTTP tests. However, long-running manual sessions could consume memory if validating large datasets. Test in a staging environment first to ensure stability with Laravel’s service providers and middleware.
- What alternatives exist for manual acceptance testing in Laravel?
- For Laravel, consider Laravel Dusk (browser testing), Pest’s interactive mode, or custom Artisan commands with Laravel’s testing helpers. If you need contract-driven validation, packages like `spatie/laravel-test-factory` or `orchestra/testbench` might offer tighter Laravel integration.
- How do I test Scrutineer’s functionality in a Laravel project before full integration?
- Start with a proof-of-concept: install Scrutineer, run its Symfony demo commands, and verify core functionality (e.g., contract validation) in a Laravel Tinker session or custom Artisan command. Use a fresh Laravel install to isolate dependencies and test memory/CPU usage.