# 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="/pages/5xkK2rzu0rNsToKeYzhr" %}
[Testing Messaging](/modelling/testing-support/testing-messaging.md)
{% endcontent-ref %}

## Core Testing Patterns

Once you understand the basics, explore these testing patterns:

{% content-ref url="/pages/nA85vW3qm3WIYqFiCjLH" %}
[Testing Aggregates and Sagas with Message Flows](/modelling/testing-support/testing-aggregates-and-sagas-with-message-flows.md)
{% endcontent-ref %}

## Specialized Testing

For specific architectural patterns:

{% content-ref url="/pages/yG28nDrwh0fQbvJV7Bil" %}
[Testing Event Sourcing Applications](/modelling/testing-support/testing-event-sourcing-applications.md)
{% endcontent-ref %}

{% content-ref url="/pages/dK3KEzTuJYoQ3N8tvcKQ" %}
[Testing Asynchronous Messaging](/modelling/testing-support/testing-asynchronous-messaging.md)
{% 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]


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ecotone.tech/modelling/testing-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
