php-http/mock-client
Mock HTTP client for HTTPlug/PHP-HTTP. Stores outgoing requests and returns queued responses or throws exceptions instead of making real network calls—ideal for unit tests of HTTP-dependent code. Install via Composer as a dev dependency.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| psr-mock/http-client-implementation | 0.87 | Tiny PSR-18 HTTP client implementation intended for mocking and testing. Provides a simple client you can plug into PSR-7/PSR-17 workflows to return predefined responses without real network calls. | 1 | 1 | 0 | 2K | 0 | 0.6 | 42.5 | MIT | 2 years ago | |
| php-mock/php-mock-integration | 0.86 | Integration layer for php-mock, making it easy to use PHP function mocks within popular test frameworks. Helps you stub built-in functions like time(), rand(), and file operations in specific namespaces, enabling reliable, isolated unit tests without touching global state. | 14 | 14 | 6 | 318K | 0 | 16.4 | 61.8 | WTFPL | 4 months ago | |
| php-mock/php-mock | 0.86 | Mock built-in PHP functions like time() or rand() in tests by leveraging PHP’s namespace fallback: define namespaced replacements for unqualified calls. Works in non-global namespaces; supports common test frameworks via integrations (e.g., PHPUnit). | 369 | 374 | 20 | 610K | 3 | 21.6 | 50.1 | WTFPL | 4 months ago | |
| psr-mock/http | 0.86 | psr-mock/http is a tiny PHP package for mocking PSR-7 HTTP messages in tests. Create predictable request/response objects without a full HTTP client, helping you unit test middleware, clients, and services with minimal setup. | 1 | 1 | 0 | 1K | 0 | 0.6 | 37.9 | MIT | 2 years ago | |
| psr-mock/http-message-implementation | 0.86 | Lightweight PSR-7 HTTP message implementation mock for testing libraries and SDKs without hard dependencies. Strictly follows PSR behavior and includes a developer-friendly API to debug and fix failing tests faster. For dev use only (PHP 8.1+). | 0 | 0 | 1 | 2K | 0 | 0.6 | 46.8 | MIT | 2 years ago | |
| guzzle/plugin-mock | 0.85 | guzzle/plugin-mock provides a mock plugin for Guzzle, letting you queue predefined responses and simulate HTTP requests during testing. Useful for isolating API clients, reproducing edge cases, and running fast, reliable unit tests without real network calls. | 3 | 3 | 0 | 3K | 0 | 0.0 | 39.3 | — | — | |
| psr-mock/http-factory-implementation | 0.85 | Lightweight PSR-17/PSR-7 HTTP factory/message mock implementation for PHP 8.1+. Built for SDKs and libraries to test against PSR interfaces without hard deps, with strict PSR compliance and helpful debugging API. | 0 | 0 | 0 | 2K | 0 | 0.6 | 46.7 | MIT | 2 years ago | |
| tomb1n0/guzzle-mock-handler | 0.84 | Lightweight mock handler for Guzzle to fake HTTP responses in tests. Queue responses, simulate status codes, headers, and body content, and inspect requests without making real network calls—useful for unit/integration testing of API clients. | 3 | 3 | 2 | 1K | 4 | 1.1 | 35.5 | MIT | — | |
| php-mock/php-mock-mockery | 0.84 | Integrates php-mock with Mockery to mock PHP built-in functions in tests. Create namespaced function mocks with PHPMockery::mock() and set expectations/returns, then call Mockery::close(). Supports only unqualified calls; define early if needed. | 39 | 39 | 5 | 71K | 2 | 1.2 | 55.3 | WTFPL | 1 year ago | |
| donatj/mock-webserver | 0.84 | Lightweight PHP mock web server for tests and local development. Spin up an HTTP server on a random port, enqueue canned responses, inspect received requests, and simulate endpoints reliably. Handy for integration tests without external services. | 138 | 139 | 22 | 57K | 5 | 26.1 | 42.8 | MIT | 3 months ago | |
| jcchavezs/httptest | 0.83 | Spin up a lightweight local HTTP server for integration testing real HTTP calls (e.g., cURL). Define a request handler to assert method/headers/body and craft responses, enabling client- and server-side assertions without mocking HTTP. | 9 | 9 | 1 | 663 | 2 | 1.7 | 23.7 | — | 8 years ago | |
| mcustiel/phiremock | 0.83 | — | 151 | 153 | 15 | 14K | 1 | 10.3 | 27.2 | GPL-3.0 | 5 years ago |
How can I help you explore Laravel packages today?