Fixes Symfony 7.4 compatibility issue in PHPUnit tests where
KernelBrowser tests fail because error renderer selection changed.
## Problem
Symfony 7.4 introduced `RuntimeModeErrorRendererSelector` in
FrameworkBundle that selects error renderer based on runtime mode:
- CLI context → plain text error output
- Web context → HTML error pages
PHPUnit runs in CLI, so Symfony 7.4 renders plain text errors. But
`KernelBrowser` simulates web requests and tests expect HTML error
pages, causing failures like:
```
Failed asserting that 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException...'
contains "The page you are looking for does not exist."
```
Tests expected HTML but got plain text exception dumps.
## Solution
Set `APP_RUNTIME_MODE=web=1` in `phpunit.xml.dist` to force web mode for
all PHPUnit tests.
This env var was introduced in Symfony 6.4 and sets the
`kernel.runtime_mode.web` parameter:
- Format: query string `web=1&worker=0`
- `web=1` → parsed to `kernel.runtime_mode.web: true`
- Backward compatible: exists in Symfony 6.4 but only affects error
rendering in 7.4+
## Why this approach vs config parameter?
**Considered alternatives:**
1. ❌ `kernel.runtime_mode.web: true` in
`config/packages/test/_sylius.yaml` - global, less flexible
2. ✅ `APP_RUNTIME_MODE=web=1` in `phpunit.xml.dist` - proper Symfony
mechanism, test-level control
The env var approach is more idiomatic and allows per-test override if
needed.
## References
- Symfony commit introducing RuntimeModeErrorRendererSelector:
|
||
|---|---|---|
| .bunnyshell | ||
| .docker | ||
| .github | ||
| adr | ||
| bin | ||
| config | ||
| etc/build | ||
| features | ||
| public | ||
| src | ||
| templates | ||
| tests | ||
| translations | ||
| .babelrc | ||
| .dockerignore | ||
| .editorconfig | ||
| .env | ||
| .env.test | ||
| .env.test_cached | ||
| .env.test_cached_payum | ||
| .gitattributes | ||
| .gitignore | ||
| .npmignore | ||
| .readthedocs.yaml | ||
| AGENTS.md | ||
| behat.yml.dist | ||
| CHANGELOG-2.0.md | ||
| CHANGELOG-2.1.md | ||
| CLAUDE.md | ||
| composer-require-checker.json | ||
| composer.json | ||
| CONFLICTS.md | ||
| docker-compose.test.yml | ||
| docker-compose.yml | ||
| ecs.php | ||
| eslint.config.mjs | ||
| LICENSE | ||
| LICENSE_OF_TRADEMARK_AND_LOGO | ||
| Makefile | ||
| monorepo-builder.php | ||
| package.json | ||
| phparkitect.php | ||
| phpstan-baseline.neon | ||
| phpstan.neon.dist | ||
| phpunit.xml.dist | ||
| README.md | ||
| rector.php | ||
| RoboFile.php | ||
| SECURITY.md | ||
| symfony.lock | ||
| UPGRADE-2.0.md | ||
| UPGRADE-2.1.md | ||
| UPGRADE-2.2.md | ||
| UPGRADE-API-2.0.md | ||
| UPGRADE-API-2.1.md | ||
| webpack.config.js | ||
Sylius is an Open Source eCommerce framework on top of Symfony.
The highest quality of code, strong testing culture, built-in Agile (BDD) workflow and exceptional flexibility make it the best solution for applications tailored to your business requirements. Powerful REST API allows for easy integrations and creating unique customer experience on any device.
We're using full-stack Behavior-Driven-Development, with PHPUnit and Behat.
Enjoy being an eCommerce Developer again!
⚙️ Installation
Install Sylius with Composer (see requirements details).
Follow the Getting started with Sylius tutorial!
📖 Documentation
Documentation is available at docs.sylius.com.
➕ Sylius Plus
Sylius Plus offers modular features like OnePageCheckout and a B2B suite, alongside advanced capabilities such as multi-store management, partial order fulfillment, smooth returns handling, a loyalty system and multi-source inventory. Pick and choose the modules you need to supercharge your eCommerce projects effortlessly.
🤝 Community
Get Sylius support on Slack or Stack Overflow or get professional SLA-backed support and Project Success Assistance with Sylius Plus license! Learn more.
Stay updated by following our Twitter and Facebook.
Would like to help us and build the most developer-friendly eCommerce framework? Start from reading our Contributing Guide!
👮 Security issues
If you think that you have found a security issue in Sylius, please do not use the issue tracker and do not post it publicly.
Instead, all security issues must be sent to security@sylius.com.
📦 Plugins and Extensions: Sylius Store
You can find Sylius plugins on our Sylius Store which is a Marketplace with Sylius extensions.
Or search for packages marked as sylius-plugin on Packagist.
📃 License
Sylius is completely free and released under the MIT License.
✍️ Authors
Sylius was originally created by Paweł Jędrzejewski.
Kudos to all Sylius contributors 🙏
... and others!
See the full list of contributors from our awesome community.





























































































