fit2ing / symfony-behat-services
此包的最新版本(1.0.3)没有可用的许可证信息。
1.0.3
2023-11-07 14:52 UTC
Requires
- doctrine/doctrine-bundle: ^2.5
- doctrine/orm: ^2.10
- symfony/framework-bundle: ^6.0
Requires (Dev)
- behat/behat: ^3.10
- friends-of-behat/mink: ^1.10
- friends-of-behat/mink-extension: ^2.6
- friends-of-behat/symfony-extension: ^2.3
- phpunit/phpunit: ^9.5
- symfony/yaml: ^6.1
README
Symfony Behat Services Bundle 提供了一套用于在 Symfony 应用程序中管理和测试服务的工具。它允许您定义服务和它们的可用性,这对于测试某些服务可能不可用或暂时禁用的情况非常有用。
目录
介绍
在 Symfony 应用程序中测试服务可能具有挑战性,尤其是在处理不同的服务可用性场景时。Symfony Behat Services Bundle 简化了服务管理,并允许您在测试目的下控制它们的可用性。
安装
要将 Symfony Behat Services Bundle 包含到您的项目中,请按照以下步骤操作
通过 Composer 需求包
composer require fittinq/symfony-behat-services
使用
添加服务
您可以使用类似于以下 Gherkin 场景来添加服务
Given there are services
| name | url |
| service1 | http://service1.com |
| service2 | http://service2.com |
标记服务为不可用
您可以使用类似于以下 Gherkin 场景来模拟服务不可用
Given service1 is unavailable
配置
更新您的项目,以便在测试设置中包含 Behat 包。
default:
default:
paths:
- behat/features
contexts:
- Fittinq\Symfony\Behat\Service\Context\ServiceContext