Files
HexaHost-GameCloud/integrations/whmcs/tests/Contract/README.md

31 lines
1.0 KiB
Markdown

# Contract tests
Contract tests validate WHMCS module requests and responses against the GameCloud integration API (`/api/v1/integrations/whmcs/*`).
## Scope
- Request signing headers (`X-HGC-Integration-ID`, `X-HGC-Signature`, `X-HGC-Idempotency-Key`, …)
- Canonical HMAC signature base string
- JSON request/response shapes from `packages/contracts/src/whmcs.ts`
- Idempotent lifecycle operations (`provision`, `suspend`, `renew`, `change-package`)
## Running
Contract tests require a reachable GameCloud API or a recorded mock server. They are not executed in CI by default.
```bash
# From integrations/whmcs after installing dev dependencies:
composer install
./vendor/bin/phpunit --testsuite Contract
```
## Fixtures
Sample WHMCS `$params` payloads and signed API examples will live under `tests/Fixtures/` as the contract suite grows.
## Related
- OpenAPI / Zod contracts: `packages/contracts/src/whmcs.ts`
- Server module client: `modules/servers/hexagamecloud/lib/ApiClient.php`
- Addon module client: `modules/addons/hexagamecloud/lib/ApiClient.php`