Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/br0ken-/environment-loader
Autoload context classes of Behat extension.
https://github.com/br0ken-/environment-loader
bdd behat behat-extension tdd testing
Last synced: 18 days ago
JSON representation
Autoload context classes of Behat extension.
- Host: GitHub
- URL: https://github.com/br0ken-/environment-loader
- Owner: BR0kEN-
- License: mit
- Created: 2016-04-01T11:43:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-17T18:41:25.000Z (about 7 years ago)
- Last Synced: 2024-08-08T19:43:17.198Z (5 months ago)
- Topics: bdd, behat, behat-extension, tdd, testing
- Language: PHP
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Behat Environment Loader
This tool - is a Behat library for auto loading context classes of extension to context environment.
[![Build Status](https://img.shields.io/travis/BR0kEN-/environment-loader/master.svg?style=flat)](https://travis-ci.org/BR0kEN-/environment-loader)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/BR0kEN-/environment-loader.svg?style=flat)](https://scrutinizer-ci.com/g/BR0kEN-/environment-loader/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/BR0kEN-/environment-loader.svg?style=flat)](https://scrutinizer-ci.com/g/BR0kEN-/environment-loader)
[![Total Downloads](https://poser.pugx.org/behat/environment-loader/downloads)](https://packagist.org/packages/behat/environment-loader)
[![Latest Stable Version](https://poser.pugx.org/behat/environment-loader/v/stable)](https://packagist.org/packages/behat/environment-loader)
[![License](https://poser.pugx.org/behat/environment-loader/license)](https://packagist.org/packages/behat/environment-loader)## Usage
See examples here:
- [TqExtension](https://github.com/BR0kEN-/TqExtension/blob/master/src/ServiceContainer/TqExtension.php#L40-L41)
- [SoapExtension](https://github.com/asgorobets/SoapExtension/blob/master/src/ServiceContainer/SoapExtension.php#L40-L41)```php
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](tests/behat/extensions)" about extension creation and usage of this library.