PHPackages                             swisnl/guzzle-fixture-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. swisnl/guzzle-fixture-handler

ActiveLibrary[Testing &amp; Quality](/categories/testing)

swisnl/guzzle-fixture-handler
=============================

Fixture handler for Guzzle 6+

3.0.0(4y ago)132.6k↓37%11MITPHPPHP ^7.4|^8.0

Since Feb 9Pushed 3y ago2 watchersCompare

[ Source](https://github.com/swisnl/guzzle-fixture-handler)[ Packagist](https://packagist.org/packages/swisnl/guzzle-fixture-handler)[ Docs](https://github.com/swisnl/guzzle-fixture-handler)[ RSS](/packages/swisnl-guzzle-fixture-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (9)Used By (1)

Fixture handler for Guzzle 6+
=============================

[](#fixture-handler-for-guzzle-6)

[![PHP from Packagist](https://camo.githubusercontent.com/f3a4f1cabc87fe464d4feff9b719c21123166a243531ad76e02b146ce8589b3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722e737667)](https://packagist.org/packages/swisnl/guzzle-fixture-handler)[![Latest Version on Packagist](https://camo.githubusercontent.com/bcc95aa6f83f760422afa073b4f86803663eb701f599e5e5324ac273d6bb8d19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722e737667)](https://packagist.org/packages/swisnl/guzzle-fixture-handler)[![Software License](https://camo.githubusercontent.com/dc68a48b2f7ac67e8075fdb4738bc734f03ae7969c5705fd11c8e38cda6ae3f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722e737667)](LICENSE)[![Buy us a tree](https://camo.githubusercontent.com/130148911f548b001b2ac68a32c0a06559977ca60ada3bf480c72ae4ea093175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e)](https://plant.treeware.earth/swisnl/guzzle-fixture-handler)[![Build Status](https://camo.githubusercontent.com/b45a1630993947b213962f6d3418a38456fd7eeda15aca432e7335263a49666c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636865636b732d7374617475732f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722f6d61737465723f6c6162656c3d7465737473)](https://github.com/swisnl/guzzle-fixture-handler/actions/workflows/tests.yml)[![Scrutinizer Coverage](https://camo.githubusercontent.com/7d7458ccbdd8e8a2d865362637eeeca0b7359089d2d0eb0402c6788c4cbb8347/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722e737667)](https://scrutinizer-ci.com/g/swisnl/guzzle-fixture-handler/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/65727a2609edf6443d685383baf921171e52f9a323bd3e5fd2a32a2b95aaa65b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f737769736e6c2f67757a7a6c652d666978747572652d68616e646c65722e737667)](https://scrutinizer-ci.com/g/swisnl/guzzle-fixture-handler/?branch=master)[![Made by SWIS](https://camo.githubusercontent.com/8c541545402619860a7346c32a176d63a2b75eb8ebb85590d06a26b62417d260/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539412538302d6d6164652532306279253230535749532d2532333037333741392e737667)](https://www.swis.nl)

This is a fixture [handler](http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html) for Guzzle 6+ and is meant for testing purposes. It is a temporary wrapper around [swisnl/php-http-fixture-client](https://github.com/swisnl/php-http-fixture-client) for packages that do not support [PSR-18: HTTP Client](https://www.php-fig.org/psr/psr-18/) yet, but require Guzzle 6+ explicitly.

Install
-------

[](#install)

```
$ composer require --dev swisnl/guzzle-fixture-handler
```

Usage
-----

[](#usage)

```
// Create client with handler
$responseBuilder = new \Swis\Guzzle\Fixture\ResponseBuilder('/path/to/fixtures');
$handler = new \Swis\Guzzle\Fixture\Handler($responseBuilder);
$handlerStack = \GuzzleHttp\HandlerStack::create($handler);
$client = new \GuzzleHttp\Client(['handler' => $handlerStack]);

// Send request
$response = $client->send(new Request(...));
```

Fixture mapping
---------------

[](#fixture-mapping)

As this is only a wrapper, please see the [documentation of swisnl/php-http-fixture-client](https://github.com/swisnl/php-http-fixture-client#fixture-mapping) for more information about using the fixtures.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/swisnl/guzzle-fixture-handler) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

SWIS ❤️ Open Source
-------------------

[](#swis-heart-open-source)

[SWIS](https://www.swis.nl) is a web agency from Leiden, the Netherlands. We love working with open source software.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~204 days

Recently: every ~298 days

Total

8

Last Release

1590d ago

Major Versions

1.0.1 → 2.0.02018-09-05

2.x-dev → 3.0.02022-01-10

PHP version history (3 changes)1.0.0PHP ^7.0

2.3.0PHP ^7.2|^8.0

3.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8734305?v=4)[SWIS](/maintainers/swisnl)[@swisnl](https://github.com/swisnl)

---

Top Contributors

[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (41 commits)")

---

Tags

fixtureguzzleguzzlehttphacktoberfesthandlermocktestingpsr-7clientFixtureGuzzleswisnlswis

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/swisnl-guzzle-fixture-handler/health.svg)

```
[![Health](https://phpackages.com/badges/swisnl-guzzle-fixture-handler/health.svg)](https://phpackages.com/packages/swisnl-guzzle-fixture-handler)
```

###  Alternatives

[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78611.9M97](/packages/zenstruck-foundry)[blastcloud/guzzler

Supercharge your app or SDK with a testing library specifically for Guzzle.

272419.3k35](/packages/blastcloud-guzzler)[aeris/guzzle-http-mock

A mock library for verifying requests made with the Guzzle Http Client, and mocking responses.

2613.1k1](/packages/aeris-guzzle-http-mock)[doppiogancio/mocked-client

A simple way to mock a client

2174.9k3](/packages/doppiogancio-mocked-client)[ikwattro/guzzle-stereo

Guzzle Recorder for recording Request/Responses and replay them back in a Mock

782.6k1](/packages/ikwattro-guzzle-stereo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
