fittinq / symfony-behat-services
Requires
- doctrine/doctrine-bundle: ^2.5
- doctrine/orm: ^2.10
- symfony/framework-bundle: ^6.0
Requires (Dev)
- behat/behat: ^3.10
- friends-of-behat/mink: ^1.10
- friends-of-behat/mink-extension: ^2.6
- friends-of-behat/symfony-extension: ^2.3
- phpunit/phpunit: ^9.5
- symfony/yaml: ^6.1
README
The Symfony Behat Services Bundle provides a set of tools for managing and testing services within your Symfony application. It allows you to define services and their availability, useful for testing scenarios where some services may be unavailable or temporarily disabled.
Table of Contents
Introduction
Testing services within a Symfony application can be challenging, especially when dealing with different service availability scenarios. The Symfony Behat Services Bundle simplifies service management and allows you to control their availability for testing purposes.
Installation
To include the Symfony Behat Services Bundle in your project, follow these steps:
Require the bundle via Composer:
composer require fittinq/symfony-behat-services
Usage
Adding Services
You can add services using a Gherkin scenario like this:
Given there are services
| name | url |
| service1 | http://service1.com |
| service2 | http://service2.com |
Marking Services as Unavailable
You can simulate service unavailability with a Gherkin scenario like this:
Given service1 is unavailable
Configuration
Update your project to include the Behat bundle in your test setup.
default:
default:
paths:
- behat/features
contexts:
- Fittinq\Symfony\Behat\Service\Context\ServiceContext