定制 widoz/phpunit-mock-utilities 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

widoz/phpunit-mock-utilities

Composer 安装命令:

composer require widoz/phpunit-mock-utilities

包简介

A set of phpunit mock utilities to make mocking more simpler

README 文档

README

Continuous Integration

A set of utilities to better mock objects and generic data for tests double.

Why

I do not needed to have different mocking tools to be honest and for me the PhpUnit mock built in library works quite good. What's annoying me most is the repetitive actions taken in order to obtain a configured mock.

I do not want to worry about if a class is abstract or it's an interface, I do not want to worry about configure methods when I need a stub instead of a mock.

I also like sometimes to test inner methods such as protected or private methods and for that reason I need mostly a Proxy.

For that reason I found my self writing again and again the same portions of code in order to obtain a configured mock/stub.

This little utility library has been realized with that intent, make a bit more easier to create a mock/stub without taking care of unnecessary details when those details are not needed to be known.

This library does not have the presumption not the goal to be another mocking library for your unit tests, if you need something which boost PhpUnit mock feature there are a lot of libraries out there :)

Features

Mock

Proxy

Fake Values

Note

This library does require an esplicit dependency for phpunit therefore it's up to you require via composer the phpunit version you want to depends on.

Requirements

  • PHP >= 7.3
  • PhpUnit >= 9

License

This library is released under MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-13