PHPackages                             jcchavezs/httptest - 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. jcchavezs/httptest

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

jcchavezs/httptest
==================

0.2.1(7y ago)98.5k—0%1[2 issues](https://github.com/jcchavezs/httptest-php/issues)7MITPHP

Since Jan 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jcchavezs/httptest-php)[ Packagist](https://packagist.org/packages/jcchavezs/httptest)[ RSS](/packages/jcchavezs-httptest/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (7)

Http Test
=========

[](#http-test)

[![Build Status](https://camo.githubusercontent.com/4f41100809b46de0ecdbba4b213e95b0443192b6bf8ba33fff3abe7cafdaba6c/68747470733a2f2f7472617669732d63692e6f72672f6a6363686176657a732f68747470746573742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jcchavezs/httptest-php)[![CircleCI](https://camo.githubusercontent.com/343b00448ca298f9a8a22bf93e658e37e7d6618e943b1b34df59fb60f2a2fd57/68747470733a2f2f636972636c6563692e636f6d2f67682f6a6363686176657a732f68747470746573742d7068702f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/jcchavezs/httptest-php/tree/master)[![Latest Stable Version](https://camo.githubusercontent.com/ea4ea62a862fa2c316d5d697667ff596d3bcbe8be9428ac4878f8c0f0da2a4e3/68747470733a2f2f706f7365722e707567782e6f72672f6a6363686176657a732f68747470746573742f762f737461626c65)](https://packagist.org/packages/jcchavezs/httptest)[![Minimum PHP Version](https://camo.githubusercontent.com/599bc5c91bb804f9384b53af2a2d7143e7b787bf82a79f1773db76ef50e51ab5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e737667)](https://php.net/)[![Total Downloads](https://camo.githubusercontent.com/c8bd3ed1cae14e04fa086eb4182638cd899bc1592ad6a4a5d41a4089655b5da2/68747470733a2f2f706f7365722e707567782e6f72672f6a6363686176657a732f68747470746573742f646f776e6c6f616473)](https://packagist.org/packages/jcchavezs/httptest)[![License](https://camo.githubusercontent.com/db9acb1a5658f83ac880dd76e9ef596387fed021c82f36e34707a7718f81d5e0/68747470733a2f2f706f7365722e707567782e6f72672f6a6363686176657a732f68747470746573742f6c6963656e7365)](https://packagist.org/packages/jcchavezs/httptest)

Library for for HTTP integration tests.

HttpTest is strongly inspired on the [httptest go library](https://golang.org/pkg/net/http/httptest)

Description
-----------

[](#description)

When testing functions that include HTTP calls, developers often create a wrapper class around `cURL`functions and mock that class in order to unit test it. This technique unit tests the class but it is also important to test the actual HTTP call which requires an HTTP server listening to those calls. This library provides such a server and allow developers to do assertions both in the client and server side.

Installation
------------

[](#installation)

```
composer require --dev jcchavezs/httptest
```

Usage
-----

[](#usage)

Test a `cURL` HTTP request:

```
