# Testing Support

{% hint style="info" %}
Works with: **Laravel**, **Symfony**, and **Standalone PHP**
{% endhint %}

## 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:

{% content-ref url="testing-support/testing-messaging" %}
[testing-messaging](https://docs.ecotone.tech/modelling/testing-support/testing-messaging)
{% endcontent-ref %}

## Core Testing Patterns

Once you understand the basics, explore these testing patterns:

{% content-ref url="testing-support/testing-aggregates-and-sagas-with-message-flows" %}
[testing-aggregates-and-sagas-with-message-flows](https://docs.ecotone.tech/modelling/testing-support/testing-aggregates-and-sagas-with-message-flows)
{% endcontent-ref %}

## Specialized Testing

For specific architectural patterns:

{% content-ref url="testing-support/testing-event-sourcing-applications" %}
[testing-event-sourcing-applications](https://docs.ecotone.tech/modelling/testing-support/testing-event-sourcing-applications)
{% endcontent-ref %}

{% content-ref url="testing-support/testing-asynchronous-messaging" %}
[testing-asynchronous-messaging](https://docs.ecotone.tech/modelling/testing-support/testing-asynchronous-messaging)
{% endcontent-ref %}

### 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

* [Testing Aggregates, Saga, Projections](https://github.com/ecotoneframework/quickstart-examples/tree/main/Testing)

### Links

* [Testing Asynchronous Message Driven Architecture](https://blog.ecotone.tech/testing-messaging-architecture-in-php/) \[Article]
* [How to make sending Messages to the Message Broker resilient](https://blog.ecotone.tech/my-database-is-not-a-message-broker/) \[Article]
* [What is and how to use Outbox Pattern](https://blog.ecotone.tech/implementing-outbox-pattern-in-php-symfony-laravel-ecotone/) \[Article]
