duncan3dc / uopz-expectations
模拟核心函数并设置与Mockery类似的期望
1.0.0
2021-08-15 10:24 UTC
Requires
- php: ^7.2 || ^8.0
- ext-uopz: *
- mockery/mockery: ^1.0
Requires (Dev)
- maglnet/composer-require-checker: ^2.0 || ^3.0
- phpstan/phpstan: ^0.12.94
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.6
README
模拟核心函数并设置与Mockery类似的期望。
完整的文档可以在http://duncan3dc.github.io/uopz-expectations/找到
PHPDoc API文档也可以在http://duncan3dc.github.io/uopz-expectations/api/找到
简介
uopz 扩展提供了一个简单的方式来模拟核心函数。
Mockery 库提供了一个简洁的API来声明期望方法调用。
这个库将这两者结合起来,提供了一个熟悉的API来模拟核心函数。
安装
安装此库的推荐方法是使用Composer。
从您的项目根目录运行以下命令
$ composer require --dev duncan3dc/uopz-expectations
入门
use duncan3dc\Mock\CoreFunction; CoreFunction::mock("time")->twice()->with()->andReturn(777); time(); # 777 /** * At this point the expectations will be checked, * and an exception will be throw as `time()` * should have been called twice. */ CoreFunction::close();
更多信息请访问http://duncan3dc.github.io/uopz-expectations/
如何获取帮助
发现了错误?有问题?或者不确定某件事情如何工作?
请创建一个问题,我会尽力帮助。
或者您可以在Twitter上找到我
duncan3dc/uopz-expectations 企业版
作为Tidelift订阅的一部分提供
duncan3dc/uopz-expectations和其他数千个包的维护者正在与Tidelift合作,为构建应用程序时使用的开源依赖项提供商业支持和维护。节省时间,降低风险,并提高代码健康,同时支付您使用的确切依赖项的维护者。了解更多信息。点击这里