larsroettig/api_mockery

API Server mocking solution written in PHP

v1.0.1-beta 2018-06-29 14:34 UTC

README

Scrutinizer Code Quality Build Status Code Coverage

ApiMockery is a simple API mocking solution written in PHP based on the Slim Framework.

Installation

 composer install

Configuration

Currently this library support swagger config files from type v2

Register File Response Handler

{
  "paths": {
    "/pets": {
      "get": {
        "x-apis-json": {
          "response_handler_type": "files",
          "response_handler": "responses/pets/pet{id}"
        }
      }
    }
  }
}

Register Service Class Response Handler

{
  "paths": {
    "/pets": {
      "get": {
        "x-apis-json": {
           "response_handler_type": "object",
           "response_handler": "\\Pets\\SaveService"
        }
      }
    }
  }
}

Example Config File

Example Implementation

Github Repo

We’re hiring!

Wanna work for one of Germany’s leading Magento partners? With agile methods, small teams and big clients? We’re currently looking for experienced PHP & Magento developers in Munich. Sounds interesting? Just drop me a line via l.roettig@techdivision.com