Transitioned from obsolete gateway object classes (`edge_gateway_shell_action_jobs_o`, `edge_gateway_shell_events_o`, `edge_gateway_shell_sessions_o`, `edge_gateway_update_jobs_o`) to the new agent implementation (`edge-gateway-agent/agent.php`).
1.4 KiB
1.4 KiB
apply
| apply |
|---|
| always |
Backend PHP Testing Rules
These rules apply to services/nginx/app/tests and any backend change that needs verification.
- Add or update tests for every new feature, bug fix, API contract change, or search or authentication workflow change.
- Run backend verification in the
php1container. Do not use host-side PHP for the supported workflow. - Use
docker compose exec -T php1 sh -lc "cd /var/www/html && composer test:unit"for unit coverage. - Use
docker compose exec -T php1 sh -lc "cd /var/www/html && composer test:integration"when code depends on Redis, MySQL, or environment-backed configuration. - Use
docker compose exec -T php1 sh -lc "cd /var/www/html && composer test:api"when route behavior, envelopes, or request parsing changes. - Keep tests deterministic: no live third-party calls, no shared Redis keys, no broad database cleanup, and no sleeps unless time behavior is the thing under test.
- Prefer narrow fixtures, explicit cleanup, and behavior-level assertions over implementation checks.
- When public routes, schemas, or permissions change, update
openapi.yamltogether with the tests. - Run the narrowest relevant suite first, then the broader suite that matches the risk before you finish the task.
Canonical workflow reference: .ai-workflow/workflow.md.