mcustiel / phiremock
A mocker for HTTP and REST services. Full bundle.
Installs: 825 458
Dependents: 4
Suggesters: 0
Security: 0
Stars: 149
Watchers: 9
Forks: 15
Open Issues: 1
Type:project
Requires
- php: ^7.2 | ^8.0
- mcustiel/phiremock-client: ^1.0
- mcustiel/phiremock-server: ^1.0
Suggests
- guzzlehttp/guzzle: Provides default http client for phiremock client and server.
- dev-master
- v2.1.1
- v2.1.0
- v2.0.0
- v2.0.0-beta.1
- v2.0.0-alpha.1
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8
- dev-version-1.x
- dev-version-2.x
- dev-version-1.x-parallel-expectation-evaluation
- dev-issue-38
- dev-issue-36
- dev-issue/30
- dev-develop
- dev-feature-proxy
- dev-feature-improvements
This package is auto-updated.
Last update: 2024-11-09 15:39:41 UTC
README
Phiremock is a mocker and stubber of HTTP services, it allows software developers to mock HTTP requests and setup responses to avoid calling real services during development, and is particulary useful during acceptance testing when expected http requests can be mocked and verified. Any HTTP service (i.e.: REST services) can be mocked and stubbed with Phiremock. Phiremock is heavily inspired by WireMock, but does not force you to have a java installation in your PHP development environment. The full functionality of Phiremock is detailed in the following list:
- Allows to mock http request based in method, headers, url and body content.
- Allows to match expectations using regexp patterns or equality.
- REST interface to setup.
- Stateful and stateless mocking.
- Network latency simulation.
- Priorizable expectations for cases in which more than one matches the request. If more than one expectation matches the request and no priorities were set, the first match is returned.
- Allows to verify the amount of times a request was done.
- Allows to load default expectations from json files in a directory tree.
- Proxy requests to another URL as they are received.
- Client with fluent interface to configure Phiremock.
- Integration to codeception through phiremock-codeception-extension and phiremock-codeception-module.
- Fill the response body using data from the request.
Note: In version 2 Phiremock has separated libraries for the server and the client. This repository became the bundle for both libraries.
Installation
Composer:
This project is published in packagist, so you just need to add it as a dependency in your composer.json:
"require-dev": { "mcustiel/phiremock": "v2.0", "guzzlehttp/guzzle": "^6.0" }
See
- Phiremock Server: https://github.com/mcustiel/phiremock-server
- Phiremock Client: https://github.com/mcustiel/phiremock-client
Thanks to:
- Denis Rudoi (@drudoi)
- Henrik Schmidt (@mrIncompetent)
- Nils Gajsek (@linslin)
- Florian Levis (@Gounlaf)
And everyone who submitted their Pull Requests.