easy-http/mock-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

easy-http/mock-builder

最新稳定版本:v1.3.0

Composer 安装命令:

composer require easy-http/mock-builder

包简介

A fluid interface to build HTTP mocks with an expressive syntax

README 文档

README

Build Status Bugs Bugs

PHP Versions Supported Total Downloads

🚀 Mock HTTP services

Mock builder

A fluid interface to build HTTP mocks with an expressive syntax. You can use this library to build mocks for Guzzle, Symfony and other HTTP Clients.

Bugs Bugs Bugs

This library supports the following versions of Guzzle Http Client.

PHP Versions Supported PHP Versions Supported

🔧 Installation

Use following command to install this library:

composer require easy-http/mock-builder

💡 Usage

Creating a simple Mock for Guzzle

use EasyHttp\MockBuilder\HttpMock;
use EasyHttp\MockBuilder\MockBuilder;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;

$builder = new MockBuilder();
$builder
    ->when()
        ->pathIs('/v1/products')
        ->methodIs('POST')
    ->then()
        ->body('bar');

$mock = new HttpMock($builder);

$client = new Client(['handler' => HandlerStack::create($mock)]);
$client
    ->post('/v1/products')
    ->getBody()
    ->getContents(); // bar

📚 Check out the Documentation to learn how to use this library.

统计信息

  • 总下载量: 35.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-06