Registry / http-client / guzzle-plugin-mock

guzzle-plugin-mock

JSON →
library3.9.2phppackagistunverified

Guzzle Mock plugin for testing HTTP clients.

composer require guzzle/plugin-mock
INSTALL
IMPORT
SIG · GUZZLE-PLUGIN-MOCK
G
guzzle-plugin-mock
http-clientphpv3.9.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MockPlugin
use Guzzle\Plugin\Mock\MockPlugin;

Mock HTTP responses for Guzzle 3.x.

<?php require 'vendor/autoload.php'; use Guzzle\Plugin\Mock\MockPlugin; use Guzzle\Http\Client; $mock = new MockPlugin(); $client = new Client(); $client->addSubscriber($mock); $mock->addResponse(new Guzzle\Http\Message\Response(200)); $response = $client->get('http://example.com'); echo $response->getStatusCode();
Debug
Known issues
breakingThis package is for Guzzle 3.x only and is deprecated. Use GuzzleHttp\Handler\MockHandler for Guzzle 6+.
fix
Migrate to GuzzleHttp\Handler\MockHandler with Guzzle 6+.
affects: >=3.0.0
Upgrade
Version history
3.9.2latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
Resources
guzzle-plugin-mock — pip install guzzle-plugin-mock · libregistry