## Summary
- `register_shutdown_function` is not invoked on SIGINT (Ctrl+C) or
SIGTERM, leaving the ephemeral MySQL container running after an
interrupted test run
- Added `pcntl_async_signals` + `pcntl_signal` handlers for SIGTERM and
SIGINT so the container is cleaned up on interruption
- Wrapped `$container->stop()` in try/catch to prevent an uncaught
exception inside the shutdown function from becoming a PHP fatal error
(which would also leave the container running)
## Summary
- Add `testcontainers/testcontainers` to `require-dev` to spin up an
ephemeral MySQL 8.0 container per test process, eliminating the need for
a local database or Docker Compose stack
- Create `tests/bootstrap.php` that starts a `MySQLContainer`, sets
`DB_*` env vars dynamically, and auto-generates `APP_KEY` when missing
(supports fresh worktrees and CI)
- Update `phpunit.xml` to use the new bootstrap file and remove the
hardcoded `DB_DATABASE` env var
## How it works
Running `php artisan test` now automatically starts a short-lived MySQL
container on a random port. Each test process gets its own isolated
database, so multiple agents, worktrees, or CI jobs can run in parallel
without conflicts.
Set `TESTCONTAINERS=false` to bypass containers and use the database
configured in `.env` instead.