rodrigodiez/mockable-predis 问题修复 & 功能扩展

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

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

rodrigodiez/mockable-predis

Composer 安装命令:

composer require rodrigodiez/mockable-predis

包简介

A class that extends Predis/Client and has all its magic methods anotated so you can create Prophecy mocks

README 文档

README

Build Status SensioLabsInsight Packagist Downloads

Mockable Predis

This project allows developers to use PhpSpec/Prophecy to TDD projects that use Predis by allowing mocks of the Client to be created.

Installation

composer require rodrigodiez/mockable-predis

Use

Just use RodrigoDiez\MockablePredis\Client class in your code instead of Predis\Client

Why is this needed?

Predis makes intensive use of magic call methods in its Client class making it impossible for some mocking frameworks to guess its interface and create mocks.

One common workaround when using magic call methods within a class is to document them using @method annotations as described here

Predis maintainers decided to document these methods in the ClientInterface instead of doing it in the Client class itself as recommended by phpdoc documentation. On the other hand, Prophecy maintainers refuse to read @method annotations from interfaces.

Full history and both sides arguments can be found here and here.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固