rezzza/json-api-behat-extension 问题修复 & 功能扩展

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

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

rezzza/json-api-behat-extension

最新稳定版本:v8.1.1

Composer 安装命令:

composer require rezzza/json-api-behat-extension

包简介

Rest Api Extension for Behat

README 文档

README

Build Status

Scrutinizer Code Quality

For now only JSON api is supported to analyze response, but you could use REST part to perform request on any type of api.

Warning

From version 7.0, namespace vendor changed from Rezzza to Ubirak.

Install

Require the package as a development dependency :

composer require --dev ubirak/rest-api-behat-extension

Don't forget to load the extension and the context if needed in your behat.yml :

default:
    extensions:
        Ubirak\RestApiBehatExtension\Extension:
            rest:
                base_url: http://localhost:8888
                store_response: true
    suites:
        default:
            contexts:
                - Ubirak\RestApiBehatExtension\RestApiContext
                - Ubirak\RestApiBehatExtension\Json\JsonContext

Then you will need to require in your composer the http client you want to use, and the message factory.

Example:

composer require --dev guzzlehttp/psr7 php-http/curl-client

Usage

You can use directly the JsonContext or RestApiContext by loading them in your behat.yml or use the RestApiBrowser and JsonInspector by adding them in the construct of your own context.

<?php
/**/

use Ubirak\RestApiBehatExtension\Rest\RestApiBrowser;
use Ubirak\RestApiBehatExtension\Json\JsonInspector;

class FeatureContext implements Context
{
    private $restApiBrowser;

    private $jsonInspector;

    public function __construct(RestApiBrowser $restApiBrowser, JsonInspector $jsonInspector)
    {
        $this->restApiBrowser = $restApiBrowser;
        $this->jsonInspector = $jsonInspector;
    }
}

统计信息

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

GitHub 信息

  • Stars: 36
  • Watchers: 11
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-13