fittinq/symfony-behat-services

There is no license information available for the latest version (1.0.3) of this package.

1.0.3 2023-11-07 14:52 UTC

This package is auto-updated.

Last update: 2024-11-07 17:06:30 UTC


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:

  1. 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