Skip to content

PSR-14 event dispatcher implementation for testing if the subject under test is emitting expected event.

License

Notifications You must be signed in to change notification settings

raigu/psr14-event-dispatcher-spy

Repository files navigation

Latest Stable Version Fallows SemVer build codecov License: MIT

psr14-event-dispatcher-spy

PSR-14 event dispatcher implementation for testing if the subject under test is emitting expected event.

Compatibility

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

Changes

./CHANGELOG.md

Install

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

Usage

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

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

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

Methods

Method Description
dispatched true if given event has been dispatched. Parameter can be event class name or event instance.

Testing

$ composer test
$ composer specification 
$ composer coverage

About

PSR-14 event dispatcher implementation for testing if the subject under test is emitting expected event.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages