Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony Behat Bundle

Symfony Behat Bundle Laravel Package

elbformat/symfony-behat-bundle

Reusable Behat contexts for Symfony apps: test commands, forms, HTML/HTTP responses, JSON, dates, logging, mailer, plus abstract contexts for custom API and database steps. Install as a dev dependency and register in behat.yml.

View on GitHub
Deep Wiki
Context7

Behat contexts for symfony applications

Frequently asked questions about Symfony Behat Bundle
What is elbformat/symfony-behat-bundle used for?
It provides predefined, reusable Behat contexts for Symfony applications, covering commands, dates, forms, HTML/HTTP responses, JSON, logging, and mailer assertions. It also ships abstract API and database contexts for project-specific steps. You install it as a dev dependency, activate the bundle in the test environment, and register the contexts in behat.yml. It complements Behat rather than replacing it.
How do I install elbformat/symfony-behat-bundle?
Run composer require --dev elbformat/symfony-behat-bundle. In a Symfony app, activate ElbformatSymfonyBehatBundle in config/bundles.php for the test environment, then add the contexts you need to behat.yml. It is a Symfony bundle, so Laravel apps do not have a native bundle registration path; treat it as a dev-only tool for Symfony services or verify your Behat/Symfony kernel setup first.
Does elbformat/symfony-behat-bundle support Laravel?
It is a Symfony bundle, not a Laravel package, and it does not ship a Laravel service provider. A Laravel app can include it as a Composer dev dependency only if Behat and the required Symfony components are already part of the test stack. The release notes mention a dual Laravel and Symfony test matrix, but Symfony 8.1 support may be unreachable under Laravel's illuminate/* constraints. Confirm with composer why-not before assuming Laravel compatibility.
Which PHP versions does elbformat/symfony-behat-bundle support?
The evaluated v1.5.13 CI matrix starts at PHP 8.3, but the notes do not make clear whether PHP 8.1 and 8.2 were dropped or simply removed from CI. Treat PHP 8.3 or newer as the safe working assumption until composer.json and the changelog confirm the actual floor. If you still run PHP 8.1 or 8.2 hosts, verify before upgrading.
Which Symfony versions are supported by elbformat/symfony-behat-bundle?
Version 1.5.13 widens framework compatibility to Symfony 7.4 and 8.1, while Symfony 5.4 remains in the test matrix. Symfony 5.4 is end-of-life, so being tested against it should not be read as a supported-and-secure signal. For Laravel consumers, illuminate/* constraints may cap Symfony components below 8.x, making the 8.1 claim relevant mainly to standalone Symfony usage.
How do I configure contexts from elbformat/symfony-behat-bundle in behat.yml?
List the desired context classes under suites.default.contexts, such as CommandContext, FormContext, HtmlContext, JsonContext, and MailerContext. The bundle is designed to work with FriendsOfBehat\SymfonyExtension for kernel bootstrap. For mailer assertions, set framework.mailer.dsn to test://test in the test environment. For API tests, configure MockClient so requests do not hit real external services.
What can I test with the built-in Behat contexts?
CommandContext tests Symfony commands, FormContext manipulates and fills HTML forms, and DateContext mocks the current date. HtmlContext checks DOM and plain HTTP responses, HttpContext handles simple HTTP interactions, and JsonContext sends or checks JSON in requests and responses. LoggingContext verifies logging, and MailerContext checks whether mails were triggered.
How do I create custom API or database Behat contexts with this bundle?
Extend AbstractApiContext for external API interaction or AbstractDatabaseContext for database interaction, then register your custom context classes in behat.yml. The abstract contexts provide a base for project-specific steps while keeping the bundle's conventions. Review the per-context documentation before implementing, since the bundle only supplies the abstract layer.
What are the alternatives to elbformat/symfony-behat-bundle for Laravel testing?
For Laravel-native testing, Pest or PHPUnit with Laravel's HTTP, console, mail, database, and facade testing helpers is the default choice. Behat is a BDD tool and is uncommon in Laravel projects; if you need Behat, FriendsOfBehat\SymfonyExtension plus this bundle is aimed at Symfony kernels. In a mixed estate, use this package only where a Symfony kernel and Behat are already established.
Is elbformat/symfony-behat-bundle safe to upgrade, and what should I check?
Treat v1.5.13 as a routine patch upgrade: bump the constraint, run composer update, execute the existing test suite, and review the lockfile diff. The highest risk is support-policy ambiguity, including the PHP floor and whether Symfony 5.4 is still supported or only tested. The move from CircleCI to GitHub Actions adds new workflow files, third-party actions, and token permissions, so review those if you consume releases or mirror the repository. Confirm composer.json, the changelog, and the security policy before production rollout.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections