raigu/psr14-event-dispatcher-spy

PSR-14事件分发器实现,用于测试待测试对象是否发出了预期的事件。

v0.1.2 2023-04-07 17:42 UTC

This package is auto-updated.

Last update: 2024-09-07 20:38:11 UTC


README

Latest Stable Version Fallows SemVer build codecov License: MIT

psr14-event-dispatcher-spy

PSR-14事件分发器实现,用于测试待测试对象是否发出了预期的事件。

兼容性

  • PHP 7.4, ^8.0
  • psr/event-dispatcher==^1.0

变更

./CHANGELOG.md

安装

$ composer require --dev raigu/psr14-event-dispatcher-spy

使用方法

$spy = new \Raigu\TestDouble\Psr14\EventDispatcherSpy();

$sut = new \Foo\Bar($spy);
$sut->bar();

assert($spy->dispatched(\Foo\BarEvent::class));

方法

测试

$ composer test
$ composer specification 
$ composer coverage