webit/test-tools
最新稳定版本:0.1.0
Composer 安装命令:
composer require --dev webit/test-tools
包简介
Web-IT Test tools
README 文档
README
Unit / Behaviour test tools
Standalone Symfony Bundle Configuration testing
Create your AppKernel:
use Webit\Tests\Behaviour\Bundle\Kernel as BaseKernel; class AppKernel extends BaseKernel { public function registerBundles() { return array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new My\BrandNewBundle(); ); // array of your Bundles } }
Create your FeatureContext and register the Kernel:
use Webit\Tests\Behaviour\Bundle\BundleConfigurationContext; class FeatureContext extends BundleConfigurationContext { public function __construct() { parent::__construct(new AppKernel()); } }
Scenario example:
Feature: MyBrandNewBundle configuration feature
In order to set up MyBrandNew library with Symfony Application
As a developer
I need Bundle Configuration / Extension
Background:
Given the configuration contains:
"""
framework:
secret: "my-secret-hash"
my_brand_new: ~
"""
Scenario: Basic configuration
When I bootstrap the application
Then there should be following services defined:
"""
my_service_one, my_service_two, my_service_three
"""
And there should be following aliases defined:
| service | alias |
| my_service.default_service | my_service.service |
And all given services should be reachable
Create as many scenarios as you need (for different configuration options). Feel free to add any other checks (steps) into your Context.
统计信息
- 总下载量: 167
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-17