PHPackages                             raigu/psr14-event-dispatcher-spy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. raigu/psr14-event-dispatcher-spy

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

raigu/psr14-event-dispatcher-spy
================================

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

v0.1.2(3y ago)06MITPHPPHP &gt;=7.4||^8.0

Since Aug 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/raigu/psr14-event-dispatcher-spy)[ Packagist](https://packagist.org/packages/raigu/psr14-event-dispatcher-spy)[ RSS](/packages/raigu-psr14-event-dispatcher-spy/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (2)Versions (4)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/1b81bc1728ac221e9aa7b0e69b825147e5d133c7f523e5668b54572f383fca75/687474703a2f2f706f7365722e707567782e6f72672f72616967752f70737231342d6576656e742d646973706174636865722d7370792f762f737461626c65)](https://packagist.org/packages/raigu/psr14-event-dispatcher-spy)[![Fallows SemVer](https://camo.githubusercontent.com/0ba7a49bc642a7fa1e7c2b21f034148f17652edb537d5aed7f0dfbe3259f8cc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d5665722d322e302e302d677265656e)](https://semver.org/spec/v2.0.0.html)[![build](https://github.com/raigu/psr14-event-dispatcher-spy/workflows/build/badge.svg)](https://github.com/raigu/psr14-event-dispatcher-spy/actions)[![codecov](https://camo.githubusercontent.com/a82e0a1135292b3baa8eb3f4e744bc50d40ad842478b4edbb7064feec2202c3e/68747470733a2f2f636f6465636f762e696f2f67682f72616967752f70737231342d6576656e742d646973706174636865722d7370792f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d56575632525239423652)](https://codecov.io/gh/raigu/psr14-event-dispatcher-spy)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

psr14-event-dispatcher-spy
==========================

[](#psr14-event-dispatcher-spy)

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

Compatibility
=============

[](#compatibility)

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

Changes
=======

[](#changes)

[./CHANGELOG.md](./CHANGELOG.md)

Install
=======

[](#install)

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

Usage
=====

[](#usage)

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

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

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

Methods
=======

[](#methods)

MethodDescriptiondispatchedtrue if given event has been dispatched. Parameter can be event class name or event instance.Testing
=======

[](#testing)

```
$ composer test
$ composer specification
$ composer coverage
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~293 days

Total

3

Last Release

1131d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82bf3ac844b3984ae4f9965188829da1729ca1e86abd92151406d15896c021b9?d=identicon)[raigu](/maintainers/raigu)

---

Top Contributors

[![raigu](https://avatars.githubusercontent.com/u/3442567?v=4)](https://github.com/raigu "raigu (16 commits)")

---

Tags

eventpsr-14spytest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/raigu-psr14-event-dispatcher-spy/health.svg)

```
[![Health](https://phpackages.com/badges/raigu-psr14-event-dispatcher-spy/health.svg)](https://phpackages.com/packages/raigu-psr14-event-dispatcher-spy)
```

###  Alternatives

[symfony/event-dispatcher-contracts

Generic abstractions related to dispatching event

3.4k756.5M424](/packages/symfony-event-dispatcher-contracts)[league/event

Event package

1.6k141.6M184](/packages/league-event)[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[yohang/finite

A simple PHP Finite State Machine

1.3k3.5M10](/packages/yohang-finite)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.4k423.9k30](/packages/mcp-sdk)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
