2017 © Pedro Peláez
 

behat-extension behat-pdo-extension

A simple PDO extension for behat.

image

lixu/behat-pdo-extension

A simple PDO extension for behat.

  • Sunday, January 1, 2017
  • by xu-li
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

This is a simple PDO extension for behat., (*1)

Install

``` bash composer require behat/behat lixu/behat-pdo-extension --dev, (*2)


# behat.yml Add following configuration items to your ```behat.yml```. ``` yml default: suites: default: path: %paths.base%/features contexts: - FeatureContext - lixu\BehatPDOExtension\Context\PDOContext extensions: lixu\BehatPDOExtension: dsn: 'mysql:host=127.0.0.1;dbname=test;charset=UTF8' username: 'root' password: ''

Write a scenario

Here is a simple scenario:, (*3)

Note: You have to implement the "When I eat one apple" step by yourself., (*4)

  Scenario: Buy a product
    Given there are following "fruits":
      | name   | stock_level |
      | apple  | 10          |
      | orange | 5           |

    When I eat one apple

    Then there should be following "fruits":
      | name   | stock_level |
      | apple  | 9           |
      | orange | 5           |

Use PDO in your feature class

If you want to use PDO in your feature class, you can simply extend your feature class from lixu\BehatPDOExtension\Context\PDOContext, and get the PDO instance by $this->getPDO()., (*5)

The Versions

01/01 2017

dev-master

9999999-dev

A simple PDO extension for behat.

  Sources   Download

MIT

The Requires

 

by xu.li