usox/hackmock
最新稳定版本:v1.4.1
Composer 安装命令:
composer require --dev usox/hackmock
包简介
Mocking framework for hacklang
README 文档
README
HackMock
Creating mock objects for hacklang - yes, seriously.
Note
Due to the use of eval, hackmock may stop working in future hhvm versions.
What works?
- Strict mode
- Creating mocks of interfaces and concrete classes
- Defining basic method expectations (parameter validation, return value definition)
What does not work?
- Everything else, especially rare and/or untested cases involving generics, etc.
use function Usox\HackMock\{mock, prospect}; class SomethingTest extends \Usox\HackMock\HackMock { public function testSomething() { $my_fine_class = mock(SomeInterface::class); prospect($my_fine_class, 'someMethodName') ->once() ->andReturn('some-fine-value'); prospect($my_fine_class, 'someOtherMethodName') ->andThrow(new \Exception('foobar')); } }
统计信息
- 总下载量: 1.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-19