Testing Support

Testing message-driven applications with Ecotone PHP

Works with: Laravel, Symfony, and Standalone PHP

The Problem

Testing your message handlers requires bootstrapping the entire framework, setting up queues, and hoping the async parts work. Unit testing a saga means mocking half the application. There's no way to test a message flow end-to-end without spinning up infrastructure - which makes tests flaky and slow.

How Ecotone Solves It

Ecotone provides in-memory testing that lets you test message flows, aggregates, sagas, and event sourcing without external infrastructure. Send commands, verify events were published, check saga state — all in isolated tests. Swap in memory for real implementations as needed, and test full asynchronous flow within single test process.


Ecotone provides comprehensive testing tools to help you write reliable tests for your message-driven applications. This section covers everything from basic unit testing to complex integration scenarios.

Getting Started

New to Ecotone Testing? Start here:

Testing Messaging

Core Testing Patterns

Once you understand the basics, explore these testing patterns:

Testing Aggregates and Sagas with Message Flows

Specialized Testing

For specific architectural patterns:

Testing Event Sourcing ApplicationsTesting Asynchronous Messaging

Performance Tips

  • Use in-memory repositories and event stores for fast tests

  • Skip unnecessary modules with withSkippedModulePackageNames()

  • Leverage Ecotone's configuration caching for large test suites

Materials

Demo

Last updated

Was this helpful?