PHPackages                             creativestyle/app-http-server-mock - 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. creativestyle/app-http-server-mock

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

creativestyle/app-http-server-mock
==================================

An minimal app http server based on PHP cli-server for use in tests

v1.0(7y ago)22.2k[1 issues](https://github.com/creativestyle/app-http-server-mock/issues)3MITPHPPHP &gt;=7.1.0

Since Nov 22Pushed 7y ago5 watchersCompare

[ Source](https://github.com/creativestyle/app-http-server-mock)[ Packagist](https://packagist.org/packages/creativestyle/app-http-server-mock)[ Docs](https://creativestyle.de)[ RSS](/packages/creativestyle-app-http-server-mock/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (2)Used By (3)

[![Travis Build Status](https://camo.githubusercontent.com/386087fb29ccc5ca888e4d882e5b40b7256a33f2fa8c29abacff408ca9e7b25d/68747470733a2f2f7472617669732d63692e6f72672f63726561746976657374796c652f6170702d687474702d7365727665722d6d6f636b2e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/386087fb29ccc5ca888e4d882e5b40b7256a33f2fa8c29abacff408ca9e7b25d/68747470733a2f2f7472617669732d63692e6f72672f63726561746976657374796c652f6170702d687474702d7365727665722d6d6f636b2e7376673f6272616e63683d6d6173746572)

PHP HTTP App Server for use in tests
====================================

[](#php-http-app-server-for-use-in-tests)

This library allows to query HTTP endpoints in your unit/integration tests without spinning up a whole webserver.

It uses PHP's built-in web-server underneath, but it's completely opaque and you don't have to worry about anything.

Usage
=====

[](#usage)

*WARNING* This has to be installed as a composer dependency - it may not work if you just drop it in.

```
composer require --dev creativestyle/app-http-server-mock

```

Now you need to subclass `Creativestyle\AppHttpServerMock\Server` and implement the only abstract method `registerRequestHandlers`:

```
