plozmun/behat-faker-extension
最新稳定版本:0.2.3
Composer 安装命令:
composer require plozmun/behat-faker-extension
包简介
Behat Faker Extension
README 文档
README
Faker PHP integration with Behat Gherkin language
Instalation
- Require this extension using Composer:
composer require --dev plozmun/behat-faker-extension
- Enable it within your Behat configuration:
# behat.yaml.dist / behat.yaml default: extensions: Plozmun\FakerExtension: locale: 'es_es' # Optional to enable locale functions
Usage
Add your PHP Faker function between braces:
Ej: {{firsName}} or complex functions {{dateTimeBetween('-5 years', '-1 years').format('Y-m-d')}}
Feature: Create a Book In order to create a new book As a admin user I need to be able to create a book Scenario: Send post to create a new book When I add "Content-Type" header equal to "application/json" When I send a "POST" request to "/api/v1/book/{{ean13}}" with body: """ { "author": { "firsName": "{{firstName}}", "lastName": "{{lastName}}" }, "title": "{{sentence}}", "createdAt": "{{dateTimeInInterval('-5 years', '-1 years').format('Y-m-d')}} } """ And the response status code should be 200 Scenario: Show published books Given the following products exist: | ean | title | | {{ean}} | {{sentence}} | | {{ean}} | {{sentence}} | When I go to "/admin/books"
Contributors
Pablo Lozano - plozmun [lead developer]
统计信息
- 总下载量: 4.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-23