raigu / psr3-log-spy
PSR-3 LoggerInterface 的间谍工具,用于测试
v0.1.1
2021-08-29 17:33 UTC
Requires
- php: >=7.4||^8.0
- psr/log: ^1.1||2.0.0
Requires (Dev)
- phpunit/phpunit: ^9.5
Provides
- psr/log-implementation: ^1.0||^2.0
README
psr3-log-spy
PSR-3 LoggerInterface 的实现,用于监视测试对象(SUT)以验证SUT是否使用了指定的记录器。
兼容性
- PHP 7.4, ^8.0
- psr/log ^1.1||2.0.0
变更
安装
$ composer require --dev raigu/psr3-log-spy
用法
$spy = new \Raigu\TestDouble\Psr3\LoggerSpy(); $sut = new Foo($spy); $sut->bar(); assert($spy->any());
方法
测试
$ composer test
$ composer specification
$ composer coverage