承接 arlauskas/cassette-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

arlauskas/cassette-generator

Composer 安装命令:

composer require arlauskas/cassette-generator

包简介

Generate files for vcr cassette

README 文档

README

Installation

composer require --dev arlauskas/cassette-generator

Usage

vendor/bin/vcg vcg_config.yaml

Configuration example

vcg_config.yaml

record-defaults:
    request:
        method: POST
        url: "'http://127.0.0.1:8080/soap'"
        headers:
            Host: "'127.0.0.1:8080'"
            Content-Type: "'text/xml; charset=utf-8;'"
            SOAPAction: "'http://tempuri.org/'"
    response:
        status:
            http_version: "'1.1'"
            code: "'200'"
            message: OK
        headers:
            Cache-Control: private
            Content-Length: "'196'"
            Content-Type: "'text/xml; charset=utf-8'"
            Server: Microsoft-IIS/8.0
            X-AspNet-Version: 4.0.30319
            X-Powered-By: ASP.NET
            Date: "'Wed, 10 Feb 2021 07:35:56 GMT'"
cassettes-settings:
    -
        name: 'integration_tests'
        input-dir: './assets/'
        output-dir: './output/'
        cassettes:
            -
                output-file: 'login_process.yaml'
                records:
                    -
                        request: 'find_user_request.xml'
                        response: 'find_user_response.xml'
                        append:
                            'request|headers|SOAPAction': 'IAppService/FindUser'
                        rewrite:
                            'response|headers|Date':
                    -
                        request: 'user_login_request.xml'
                        response: 'user_login_response.xml'
                        append:
                            'request|headers|SOAPAction': 'IAppService/Login'
                        rewrite:
                            'response|headers|Date':
            -
                output-file: 'registration_process.yaml'
                records:
                    -
                        request: 'check_code_request.xml'
                        response: 'check_code_response.xml'
                        append:
                            'request|headers|SOAPAction': 'IAppService/CheckCode'
                        rewrite:
                            'response|headers|Date':
                    -
                        request: 'pass_code_request.xml'
                        response: 'pass_code_response.xml'
                        append:
                            'request|headers|SOAPAction': 'IAppService/PassCode'
                        rewrite:
                            'response|headers|Date':

find_user_request.xml

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
    <SOAP-ENV:Body>
        <ns1:FindUser>
            <ns1:User>test@example.com</ns1:User>
        </ns1:FindUser>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

find_user_response.xml

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
    <SOAP-ENV:Body>
        <ns1:FindUserResponse>
            <ns1:FindUserResult>true</ns1:FindUserResult>
        </ns1:FindUserResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Config reference

record-defaults

In every record will be provided default information.

cassettes-settings

Here you will provide configuration how your files structure will look like. Cassette will be written into files and every will have one or more records. record-defaults data will be provided into every record.

request and response will try to look files from input-dir from cassettes holder.

append will add data provided by record-defaults settings.

rewrite will replace data provided by record-defaults settings.

Every cassette will be written to directory output-dir and named by output-file.

arlauskas/cassette-generator 适用场景与选型建议

arlauskas/cassette-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 36 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 arlauskas/cassette-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 arlauskas/cassette-generator 我们能提供哪些服务?
定制开发 / 二次开发

基于 arlauskas/cassette-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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