Skip to content

A behat extension to automatically retrieve contexts

License

Notifications You must be signed in to change notification settings

Zayon/behat-gather-context-extension

Repository files navigation

Behat Context Gatherer Extension

Table of contents

Installation

Compatible with PHP 7.4 and later.

Compatible with Behat 3.0.0 and later

  1. Require this extension using Composer
composer require --dev zayon/behat-gather-context-extension
  1. Enable it within your Behat configuration:
# behat.yaml.dist / behat.yaml

default:
  extensions:
    Zayon\BehatGatherContextExtension\ContextGathererExtension: ~

Usage

<?php
# tests/Behat/DemoContext.php

namespace Acme\Tests\Behat;

use Behat\Behat\Context\Context;

final class DemoContext implements Context
{
    // a beforeScenario hook will automatically be created to gather AnotherContext
    private AnotherContext $anotherContext;
}

Versioning and release cycle

This package follows semantic versioning.

License

This extension is completely free and released under permissive MIT license.