Skip to content

Testing integrations

Tests cover URL normalization, endpoint mappings, response parsing, paginators, request validation, model hydration, exception mapping, and retries.

Run the package suite

composer test

Static analysis:

composer analyse

OpenAPI coverage test

OpenApiCoverageTest parses resources/openapi.yaml and checks every HTTP operation against EndpointCatalog. Modifying the OpenAPI specification causes test failures until the SDK mapping updates.

Application integration tests

Prior to deploying a credential, test:

  1. a valid scoped read;
  2. invalid or missing credentials;
  3. missing-scope responses;
  4. organization boundary checks;
  5. relationship validation errors;
  6. credential revocation;
  7. a write and its audit actor;
  8. pagination behavior.

Mocking the SDK

Mock a repository or gateway interface around the SDK rather than mocking SDK service methods:

interface WorkTracker
{
    public function createDeploymentTicket(string $release): string;
}

The production implementation uses OkatanaClient. Domain tests use an in-memory fake.