linkorb/transmogrifierextension 问题修复 & 功能扩展

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

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

linkorb/transmogrifierextension

Composer 安装命令:

composer require --dev linkorb/transmogrifierextension

包简介

Behat Extension for the Transmogrifier database fixture library

README 文档

README

Transmogrifier is a tool to help setup your database fixtures before running your tests.

This is repository contains the Transmogrifier Extension for Behat.

This allows you to use Transmogrifier directly from your Behat .feature files!

Adding the extension will activate a few new Gherkin commands to help you initialize your database testing fixtures.

Installing the extension through composer

Open your composer.json file, and add this to the require section:

"linkorb/transmogrifierextension": "dev-master"

Enabling the Behat extension

Edit your features/bootstrap/FeatureContext.php file, and add the following line to the __construct method:

$this->useContext(
    'transmogrifier',
    new \LinkORB\TransmogrifierExtension\TransmogrifierContext($parameters)
);

How to use the extension in your .feature files

You can use the following new syntax in your .feature files:

    Scenario: Applying a yml dataset to the `test` database
        Given I connect to database "test"
        When I apply dataset "user.yml"
        Then I should have "2" records in the "user" table

This example scenario will tell Behat to connect to the database test, load dataset user.yml, and apply it. After that it will verify the user table contains 2 records (just like the yml file).

Configuring the extension in behat.yml

For this to work, you will need to tell Behat and Transmogrifier where to find your datasets, and where to find your database config files.

Edit your behat.yml file, and add the following:

default:
    extensions:
        LinkORB\TransmogrifierExtension\Extension:
            dbconf_dir: /share/config/database/
            dataset_dir: example/

These paths can be either absolute or relative from the directory where you start Behat.

Behat example

The features/ directory in this repository contains a fully functional transmogrifier.feature file.

More info?

Check the Transmogrifier repo for more information: http://www.github.com/linkorb/transmogrifier/

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering.

Btw, we're hiring!

统计信息

  • 总下载量: 51
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 10
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固