Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.9 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.9 KB

Behat Environment Loader

This tool - is a Behat library for auto loading context classes of extension to context environment.

Build Status Coverage Status Quality Score Total Downloads Latest Stable Version License

Usage

See examples here:

namespace Behat\ExampleExtension\ServiceContainer;

// ...

class ExampleExtension implements Extension
{
    // ...
    
    /**
     * {@inheritdoc}
     */
    public function load(ContainerBuilder $container, array $config)
    {
        // Load all context classes from "Behat\ExampleExtension\Context\*" namespace.
        $loader = new EnvironmentLoader($this, $container, $config);
        // Your own environment reader can be easily added.
        // $loader->addEnvironmentReader();
        $loader->load();
    }
    
    // ...
}

Here is a good "how to" about extension creation and usage of this library.