PHPackages                             alirezamires/php-dummy-server - 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. alirezamires/php-dummy-server

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

alirezamires/php-dummy-server
=============================

It simplifies testing by enabling you to define various responses (success, failure) and isolate your application from external dependencies

0.0.3(1y ago)26MITPHPPHP ^8

Since Aug 2Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (2)Used By (0)

PHP Dummy Server: Simulate APIs for Easy Testing
================================================

[](#php-dummy-server-simulate-apis-for-easy-testing)

The PHP Dummy Server is a library that allows you to create a mock server environment for testing applications that rely on external APIs or services. It simplifies testing by enabling you to define various responses (success, failure) and isolate your application from external dependencies.

Benefits:
---------

[](#benefits)

Reliable Tests: Ensures tests fail only due to genuine bugs in your code, not external factors. Flexible Responses: Simulate different API responses (success, errors) for various test scenarios. Decoupled Development: Start development on your application even before the actual service is available. Isolated Teams: Allows development teams to work independently even if the real service is unstable. Simplified Debugging: Isolate issues during deployment and debugging by simulating specific services locally.

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

Install the library using Composer:

```
composer require alirezamires/php-dummy-server --dev
```

### Configuration

[](#configuration)

Edit the `server.php` file:

Define the Data Directory: Set the PHP\_DUMMY\_SERVER\_ROOT\_DIR constant to specify the location for storing dummy server data (e.g., responses).

```
