软件包/mashware / open-api-messaging-context
Behat 测试环境,用于验证 symfony 2 的 OpenApi 架构的消息
v2.1.1
2021-09-14 11:14 UTC
Requires
- php: ^7.4
- ext-json: *
- behat/mink: ^1.8
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.3
- behat/symfony2-extension: ^2.1
Requires (Dev)
- pccomponentes/coding-standard: ^1.0
- phpunit/phpunit: ^9.0
- symfony/var-dumper: ^2.8
README
在 behat 中提供少量上下文,用于根据 AsyncApi 和 OpenApi 规范验证已发布的消息和 HTTP 响应。
安装
composer require --dev mashware/open-api-messaging-context
如何使用
在您的 behat.yml
中配置上下文
default: suites: default: contexts: - PcComponentes\OpenApiMessagingContext\Behat\ResponseValidatorOpenApiContext: - '%%kernel.project_dir%%'
检查您的 openapi 文件中是否记录了 HTTP 响应
Then the response should be valid according to OpenApi "docs/openapi.yml" with path "/your/openapi/path/" And the JSON response should be valid according to OpenApi "docs/openapi.yml" schema "MySchema"