ikwattro / sublime-behat-snippets

Sublime Text 2 Snippets for Behat and Mink - write really really fast BDD
18 stars 7 forks source link

Sublime Behat Snippets

Speed up your bdd writes!

nb: for Mink snippets, please use Mink folder.

Installation

Clone the repo in your personal SublimeText2/Packages folder.

Basic Usage

The snippets are easily accessible by just typing the triggerNames followed by the tab key.

Fill in then the placeholders with the needed values

Available snippets (triggerNames)

Behat

feature

Feature: (Your feature)
    In order to (to what?)
    As a (as a what?)
    I need (what da ya need?)

scenario

Scenario: (Scenario Description)
    Given I (Given?)
    And (And?)
    When I (when?)
    Then I (then?)

iHave

/**
* @Given /I have a (What da ya hav?) "([^"]*)"/
*/
public function iHaveA(What da ya hav?)($name)
{
    //(Your code here...)
}

iShould

/**
* @Then /I should (What should ya do?) "([^"]*)" in category "([^"]*)"/
*/
public function iShould(CamelShould)(Arguments)
{
    //Your code here
}
Rapid Snippets

giha => Given I have a aiha => And I have a ...

Mink

minkSession

$session = new \Behat\Mink\Session($driver);
$session->start();

minkContent

$content = $session->getPage()->getContent();

Todo's

Feel free to improve this package