A fluid interface to build HTTP mocks with an expressive syntax

v1.2.0 2023-09-25 01:18 UTC

This package is auto-updated.

Last update: 2023-11-25 01:38:43 UTC



Build Status Code Quality Code Coverage


PHP Versions Supported Total Downloads

🚀 Mock HTTP services

Mock builder

A fluid interface to build HTTP mocks with an expressive syntax. You can use this library to build mocks for Guzzle, Symfony and other HTTP Clients.

Bugs Bugs Bugs

This library supports the following versions of Guzzle Http Client.

PHP Versions Supported PHP Versions Supported

🔧 Installation

Use following command to install this library:

composer require easy-http/mock-builder

💡 Usage

Creating a simple Mock for Guzzle

use EasyHttp\MockBuilder\HttpMock;
use EasyHttp\MockBuilder\MockBuilder;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;

$builder = new MockBuilder();

$mock = new HttpMock($builder);

$client = new Client(['handler' => HandlerStack::create($mock)]);
    ->getContents(); // bar

📚 Check out the Documentation to learn how to use this library.