PHPackages                             bigfoot90/phpacto - 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. [API Development](/categories/api)
4. /
5. bigfoot90/phpacto

ActiveProject[API Development](/categories/api)

bigfoot90/phpacto
=================

Contract testing tool integrated with Guzzle and Phpunit

1.0.2(1y ago)52.6k↓100%3[6 issues](https://github.com/PHPacto/PHPacto/issues)GPL-3.0PHPPHP &gt;=8.2

Since Nov 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PHPacto/PHPacto)[ Packagist](https://packagist.org/packages/bigfoot90/phpacto)[ RSS](/packages/bigfoot90-phpacto/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (15)Versions (47)Used By (0)

PHPacto
=======

[](#phpacto)

Contract testing solution for your API's and microservices

If you want to know more about Contract Testing please read more [here](https://martinfowler.com/bliki/IntegrationContractTest.html) and [here](http://www.testautomationguru.com/best-practices-microservices-contract-testing).

[![License](https://camo.githubusercontent.com/3234a42c22f8fa75fc4cedcd74f71aa2fcf5a494fdf4ed85f2a3604939ab754d/68747470733a2f2f706f7365722e707567782e6f72672f626967666f6f7439302f7068706163746f2f6c6963656e7365)](https://packagist.org/packages/bigfoot90/phpacto)[![Build Status](https://camo.githubusercontent.com/0b36471ae90c66dfa207040d0846841d6f0b17b9c020034efb0ed5f899766a6b/68747470733a2f2f7472617669732d63692e6f72672f5048506163746f2f5048506163746f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PHPacto/PHPacto)[![CodeCov](https://camo.githubusercontent.com/1db09f9e8cd7ef0f85eafad0d6c507101c446a3fe938552d365ca6c2a9d765f0/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f626967666f6f7439302f7068706163746f2e737667)](https://codecov.io/github/bigfoot90/phpacto)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/cea6508e973af1946e431b3175f7bdd99bd56fd43920a3dc49a06dc9a2c12b95/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5048506163746f2f5048506163746f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PHPacto/PHPacto)[![Codacy Quality Grade](https://camo.githubusercontent.com/23575b3d42907bef447cdfb6c71dda68d544e8e0328de9dd90fd72d210721b42/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3563613466643263633130343463643139323338303463376136636663353938)](https://www.codacy.com/app/bigfoot90/phpacto?utm_source=github.com&utm_medium=referral&utm_content=bigfoot90/phpacto&utm_campaign=Badge_Grade)[![Latest Stable Version](https://camo.githubusercontent.com/b2ec04a1cfc635acab4b5d910dd74d72df85c961928da5fb7a08ac2523ae4441/68747470733a2f2f706f7365722e707567782e6f72672f626967666f6f7439302f7068706163746f2f762f737461626c65)](https://packagist.org/packages/bigfoot90/phpacto)[![Total Downloads](https://camo.githubusercontent.com/428aa7a3d55fe00fa60ba0fd21e4e2973857086fa335dd113d706f30df84401d/68747470733a2f2f706f7365722e707567782e6f72672f626967666f6f7439302f7068706163746f2f646f776e6c6f616473)](https://packagist.org/packages/bigfoot90/phpacto)

[![Docker Build Status](https://camo.githubusercontent.com/6e2b808cc22b97b0217d33803ef424288065e79abf37c5c1dcaec774c05fba3e/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f6275696c642f7068706163746f2f6d6f636b2d7365727665722e737667)](https://hub.docker.com/r/90bigfoot/phpacto)[![Docker Image Size](https://camo.githubusercontent.com/643fee30de0eac19e13bad65ebcd0af46a8394ceb786f0a379eafa4fc2926d44/68747470733a2f2f696d616765732e6d6963726f6261646765722e636f6d2f6261646765732f696d6167652f7068706163746f2f6d6f636b2d7365727665722e737667)](https://hub.docker.com/r/90bigfoot/phpacto)[![Docker Pulls](https://camo.githubusercontent.com/b83604a66e7c9b64865063468b5905e674d7f592116de5d1bb59e7ac37cc8a68/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f7068706163746f2f6d6f636b2d7365727665722e737667)](https://hub.docker.com/r/90bigfoot/phpacto)[![Docker Stars](https://camo.githubusercontent.com/7a53d60da532cd660f42b74f8eecfd5511f121a93c309b10af7f82f55b252017/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f73746172732f7068706163746f2f6d6f636b2d7365727665722e737667)](https://hub.docker.com/r/90bigfoot/phpacto)

> DISCLAIMER: This is a work in progress. The code can be subject to any changes **without BC** until the release version `1.0.0`. Please use the issue tracker to report any enhancements or issues you encounter.

You can find some contract examples in `examples` directory.

Usage standalone CLI
====================

[](#usage-standalone-cli)

First of all clone this repository `git clone git@github.com:PHPacto/PHPacto.git`and install vendors with composer `composer install`.

Validate
--------

[](#validate)

Validate your contracts with

```
bin/phpacto validate path-to/directory-or-single-file
```

cURL command generator
----------------------

[](#curl-command-generator)

Generate cURL commands from contracts with

```
bin/phpacto curl path-to/directory-or-single-file
```

> SUGGESTION: Can use [phpdotenv](https://github.com/vlucas/phpdotenv) to load environment variables from file.

Usage with Docker
=================

[](#usage-with-docker)

Validate
--------

[](#validate-1)

Validate your contracts with

```
docker run -it --rm \
    -v $PWD/contracts:/srv/data \
    -e CONTRACTS_DIR=data \
    -p 8000:8000 \
    phpacto/mock-server \
    validate
```

cURL command generator
----------------------

[](#curl-command-generator-1)

Generate cURL commands from contracts with

```
docker run -it --rm \
    -v $PWD/contracts:/srv/data \
    -e CONTRACTS_DIR=data \
    -p 8000:8000 \
    phpacto/mock-server \
    curl
```

Server Mock
===========

[](#server-mock)

See

Mock Proxy Recorder
===================

[](#mock-proxy-recorder)

See

Testing your application
========================

[](#testing-your-application)

Compatibility table

PHPactoPHPPHPUnitGuzzleSymfony Serializer0.5.4`>=7.2``^7.0^8.01.0.0`>=8.2``^7.0^8.0If your project satisfies these requirements, you can run `composer require --dev bigfoot90/phpacto` and test your contracts with phpunit, else you need to run contracts testing with PHPacto's CLI wich is slower but works with any kind of application.

Integration with PHPUnit
========================

[](#integration-with-phpunit)

If your test ends with too much verbose tracelog maybe your TestCase is not extending from `Bigfoot\PHPacto\Test\PHPUnit\PHPactoTestCase`, so add this line in your `setUp` method:

```
PHPUnit\Util\Blacklist\Blacklist::$blacklistedClassNames[__CLASS__] = 1;
```

See this Gist There are two different test files `ConsumerTest.php` and `ProviderTest.php`

Mastering with PHPacto contract Rules
=====================================

[](#mastering-with-phpacto-contract-rules)

Read the dedicated page [here](docs/Rules.md)

Contributing
============

[](#contributing)

Feel free to contribute by opening a pull request. Bug fixes or feature suggestions are always welcome.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.3% 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 ~59 days

Recently: every ~290 days

Total

45

Last Release

508d ago

Major Versions

0.5.4 → 1.0.02024-10-28

PHP version history (4 changes)0.1.0PHP ^7.1

0.4.0PHP &gt;=7.1

0.5.0PHP &gt;=7.2

1.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/378970fef61b382fc291253105d437413a756deb0a9aa8890151b6bc57089ea9?d=identicon)[bigfoot](/maintainers/bigfoot)

---

Top Contributors

[![bigfoot90](https://avatars.githubusercontent.com/u/4598274?v=4)](https://github.com/bigfoot90 "bigfoot90 (174 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (1 commits)")[![JellyBellyDev](https://avatars.githubusercontent.com/u/190820?v=4)](https://github.com/JellyBellyDev "JellyBellyDev (1 commits)")[![Notradame](https://avatars.githubusercontent.com/u/44583608?v=4)](https://github.com/Notradame "Notradame (1 commits)")

---

Tags

apicontract-testingtest-automationtesting-tools

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bigfoot90-phpacto/health.svg)

```
[![Health](https://phpackages.com/badges/bigfoot90-phpacto/health.svg)](https://phpackages.com/packages/bigfoot90-phpacto)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)

PHPackages © 2026

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