alteris/behat-zendframework-extension
最新稳定版本:v1.0.0
Composer 安装命令:
composer require alteris/behat-zendframework-extension
包简介
Extension connect Behat scenario with Zendframework application
README 文档
README
Integration Behat ^3.1 with Zend\Mvc\ApplicationInterface.
This should allow integrate with Zend framework v2.* and v3.*.
Installing extension
The easiest way to install is by using Composer:
$> curl -sS https://getcomposer.org/installer | php $> php composer.phar require alteris/behat-zendframework-extension='~1.0'
or composer.json
"require": {
"alteris/behat-zendframework-extension": "~1.0"
},
Configuration
You can then activate the extension in your behat.yml:
default:
# ...
extensions:
Alteris\BehatZendframeworkExtension\ServiceContainer\Extension:
configuration: PATH_TO_application.config.php
Injecting Application
Your context need to implement Alteris\BehatZendframeworkExtension\Context\ContextAwareInterface and will be intialized with Zend\Mcv\ApplicationInterface;
Injecting Services
The extension will automatically convert parameters injected into a context. You need to have set alias/name starting with '@':
default:
suites:
default:
contexts:
- FeatureContext:
testService: '@testService'
extensions:
Alteris\BehatZendframeworkExtension\ServiceContainer\Extension:
configuration: PATH_TO_application.config.php
The FeatureContext will then be initialized with the service from the Zend Framework container:
<?php
namespace FeatureContext;
use Behat\Behat\Context\Context;
use ModuleTest\Service\TestService;
class FeatureContext implements Context
{
public function __construct(TestService $testService)
{
//Service from Zend\Mvc\Application
}
}
Extra
- Available integration with Apigility with Alteris\BehatApigilityExtension
Examples
Versioning
Staring version 1.0.0, will follow Semantic Versioning v2.0.0.
Contributors
统计信息
- 总下载量: 21.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-27