davedevelopment/behat-registry
Composer 安装命令:
composer require davedevelopment/behat-registry
包简介
Inject a registry in to feature contexts
README 文档
README
What is it?
A little extension that allows a simple registry to be injected in to FeatureContexts, allowing steps to share data across contexts if necessary
Installation
The only documented way to install behat-registry is with composer
$ composer.phar require --dev davedevelopment/behat-registry:*
Usage
Add the extension to your behat.yml file:
default: extensions: DaveDevelopment\BehatRegistry\Extension:
If you implement the
DaveDevelopment\BehatRegistry\Context\Initializer\RegistryAwareInterface with
your Context classes, they will have a Registry injected.
<?php use DaveDevelopment\BehatRegistry\Context\Initializer\RegistryAwareInterface; use DaveDevelopment\BehatRegistry\Registry; class FeatureContext implements RegistryAwareInterface { public function setRegistry(Registry $registry) { $this->registry = $registry; }
If you want some items to persist between scenarios, call the persist method with the key.
<?php $this->registry->userId = 123; $this->registry->persist("userId");
Copyright
Copyright (c) 2012 Dave Marshall. See LICENCE for further details
统计信息
- 总下载量: 5.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-04-18