🆕TestApplication
Introduction
Testing is a critical aspect of maintaining high-quality Sylius plugins. Historically, plugin developers were required to maintain a full Sylius-based application inside their plugin repositories—typically located under tests/Application. While this approach worked, it came with a number of drawbacks, including duplicated configuration, high maintenance cost, and frequent compatibility issues between Sylius core and the test application embedded in each plugin.
To address these challenges, the Sylius team introduced the TestApplication, a centrally managed, reusable Sylius application specifically designed for plugin testing. Instead of each plugin bundling its own test application, developers now leverage this standalone test environment, located in the vendor/sylius/test-application package, and configure only the plugin-specific aspects within a lightweight tests/TestApplication overlay.
What is the Sylius Test Application?
The Sylius Test Application is an official development tool that provides a preconfigured, ready-to-use Sylius setup for testing and running Sylius plugins. It is distributed as a Composer package and can be included as a development dependency in any plugin project.
With this new setup:
The full application lives in the vendor directory, managed by the Sylius team.
Each plugin only provides configuration overlays, such as enabled bundles, routes, or environment variables.
The plugin’s tests/TestApplication directory contains only what’s necessary to integrate with the global test environment.
Why Use the Test Application?
The Test Application offers multiple advantages over the legacy tests/Application approach:
Centralization and Reusability
No need to replicate the entire Sylius app structure per plugin.
A single, shared application supports many plugins, reducing clutter and maintenance.
Simplified Setup
Developers can get started by defining a few environment variables and configuration files.
No manual scaffolding or duplication of Sylius code is necessary.
Faster Iteration and Testing
Upgrading Sylius versions becomes easier, as the core application is versioned and managed separately.
Tests run consistently across plugins due to standardized bootstrapping.
CI and Developer Experience
Easily integrates with CI pipelines.
Provides predictable and consistent environments across contributors and machines.
Foundation for the Future
Aligns with modern Symfony practices.
Encourages clean separation of concerns and modular design in plugin development.
Last updated
Was this helpful?