php-testinglisted
Install: claude install-skill MuHamza30/paypal-api-plugin
# Testing code that uses an APIMatic PHP SDK
**Start from the constraint:** the client builder has **no HTTP-client setter**, no handler stack, no
adapter and no base-URL option. Nothing in `src/` lets you swap the transport. Any advice that starts
"inject a mock HTTP client" does not apply to these SDKs — check `src/{Client}Builder.php` and you will
find only configuration values, credentials builders, `httpCallback` and `proxyConfiguration`.
So the seam is **above** the SDK, not inside it.
> Read the real accessor and class names from `src/{Client}.php` and the controller folder
> (`src/Controllers/` or `src/Apis/`, whichever `ls src/` shows); the class suffix is `Controller` on
> some builds and `Api` on others, so do not assume one.
The examples below use PHPUnit for reference only — mirror whatever the project already uses.
## Preferred seam — your own interface
Wrap the operations you actually use behind a narrow interface you own and fake that, so your tests
stay independent of SDK internals and survive regeneration. That gateway is also where error translation
belongs — it is the one place that knows how to unwrap an `ApiResponse` and what a failed one means.
Test your application against the interface, and the implementation against the SDK separately.
## Doubling the SDK classes directly
There are **no `final` classes and no `final` methods**, so PHPUnit can double a controller or
the client itself. `createMock()` does not invoke the constructor, which matte