raigu/psr3-log-spy

PSR-3 LoggerInterface 的间谍工具,用于测试

v0.1.1 2021-08-29 17:33 UTC

This package is auto-updated.

Last update: 2024-08-29 05:38:05 UTC


README

Latest Stable Version Fallows SemVer build codecov License: MIT

psr3-log-spy

PSR-3 LoggerInterface 的实现,用于监视测试对象(SUT)以验证SUT是否使用了指定的记录器。

兼容性

  • PHP 7.4, ^8.0
  • psr/log ^1.1||2.0.0

变更

./CHANGELOG.md

安装

$ 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