plozmun/behat-faker-extension 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Require this extension using Composer:
composer require --dev plozmun/behat-faker-extension
  1. 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')}}

Faker PHP Documentation

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-23