bigfoot90/phpacto 问题修复 & 功能扩展

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

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

bigfoot90/phpacto

Composer 安装命令:

composer create-project bigfoot90/phpacto

包简介

Contract testing tool integrated with Guzzle and Phpunit

README 文档

README

Contract testing solution for your API's and microservices

If you want to know more about Contract Testing please read more here and here.

License Build Status CodeCov Scrutinizer Quality Score Codacy Quality Grade Latest Stable Version Total Downloads

Docker Build Status Docker Image Size Docker Pulls Docker Stars

DISCLAIMER: This is a work in progress. The code can be subject to any changes without BC until the release version 1.0.0. Please use the issue tracker to report any enhancements or issues you encounter.

You can find some contract examples in examples directory.

Usage standalone CLI

First of all clone this repository git clone git@github.com:PHPacto/PHPacto.git and install vendors with composer composer install.

Validate

Validate your contracts with

bin/phpacto validate path-to/directory-or-single-file

cURL command generator

Generate cURL commands from contracts with

bin/phpacto curl path-to/directory-or-single-file

SUGGESTION: Can use phpdotenv to load environment variables from file.

Usage with Docker

Validate

Validate your contracts with

docker run -it --rm \
    -v $PWD/contracts:/srv/data \
    -e CONTRACTS_DIR=data \
    -p 8000:8000 \
    phpacto/mock-server \
    validate

cURL command generator

Generate cURL commands from contracts with

docker run -it --rm \
    -v $PWD/contracts:/srv/data \
    -e CONTRACTS_DIR=data \
    -p 8000:8000 \
    phpacto/mock-server \
    curl

Server Mock

See https://github.com/PHPacto/mock-server

Mock Proxy Recorder

See https://github.com/PHPacto/recorder

Testing your application

Compatibility table

PHPacto PHP PHPUnit Guzzle Symfony Serializer
0.5.4 >=7.2 `^7.0 ^8.0
1.0.0 >=8.2 `^7.0 ^8.0

If your project satisfies these requirements, you can run composer require --dev bigfoot90/phpacto and test your contracts with phpunit, else you need to run contracts testing with PHPacto's CLI wich is slower but works with any kind of application.

Integration with PHPUnit

If your test ends with too much verbose tracelog maybe your TestCase is not extending from Bigfoot\PHPacto\Test\PHPUnit\PHPactoTestCase, so add this line in your setUp method:

PHPUnit\Util\Blacklist\Blacklist::$blacklistedClassNames[__CLASS__] = 1;

See this Gist https://gist.github.com/bigfoot90/d4f146bacad359329d219a804f6cd12a There are two different test files ConsumerTest.php and ProviderTest.php

Mastering with PHPacto contract Rules

Read the dedicated page here

Contributing

Feel free to contribute by opening a pull request. Bug fixes or feature suggestions are always welcome.

bigfoot90/phpacto 适用场景与选型建议

bigfoot90/phpacto 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.63k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 11 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 bigfoot90/phpacto 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2017-11-03