Download the PHP package pachico/hoverphp without Composer
On this page you can find all versions of the php package pachico/hoverphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pachico/hoverphp
More information about pachico/hoverphp
Files in pachico/hoverphp
Package hoverphp
Short Description PHP library for Hoverfly
License MIT
Homepage https://github.com/pachico/hoverphp
Informations about the package hoverphp
HoverPHP
Small PHP library to interact with Hoverfly.
Note: this library is in very early stages and its API can be subject to change.
Motivation
Docker has provided a way to easily craft integration tests. However, it won't always solve your problems. Let's say you want to do integration test against AWS SDK, or against a Prometheus instance that already contains a lot of data points, or against an application of yours that can easily be used in a container. In these scenarios, Docker images won't do the trick, and this is where Hoverfly shines, by allowing you to have an easy way to capture and then simulate HTTP responses acting as both proxy and webserver.
However, although it's hoverctl
cli app is easy to use, it's not integrated in the PHP ecosystem and, therefore,
forces you to do some cumbersome orchestration to put your tests alongside your simulation definitions.
Luckily, it has an awesome REST API. HoverPHP is a tiny SDK to manage that REST API from within your test cases.
For convenience, it is able to define simulations by using classes that implement PSR-7: HTTP message interfaces.
At the moment, it only handles those features related to setting up simulations, which was the main motivation for this library. However, it can be easily extended if required. Feel free to fill an issue for that.
Install
Via Composer
Usage
Refer to the examples/folder;
Simple use case
Your integration test wants to make sure that your application SuperApp
successfully communicates with service SuperService
.
This is what a test case could look like:
Exporting simulations
This is an example that shows how to export simulations
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
All versions of hoverphp with dependencies
guzzlehttp/guzzle Version ^7.3
justinrainbow/json-schema Version ^5.2
league/uri-components Version ^2.3