Behat 1.1 is out

Published on

Apr 3, 2011

technical

Apr 4, 2011 − Where are Behat news? Here they are - new major release after only 1 month from previous one! Discover the cooolness of regular major releases!

Hey ya! Behat 1.1 is out. Another big release with cool new features in only one month after previous one. Cool, yeah?

Installation

pear upgrade behat/gherkin
pear upgrade behat/behat

New configuration system

Want to configure your behat from start to the end? And share your entire configuration between projects? Aaaand define multiple suite running profiles? With the new configuration system, it's as easy as 1-2-3:

# behat.yml
default:
    formatter:
        name:   'progress'
pretty:
    formatter:
        name:   'pretty'
        multiline_arguments: false
imports:
    - 'your_pear_package_or_php_lib/sources/behat_config.yml'
    - '/full/path/to/b_config.yml'

Read more about it in the all new "Configuration" documentation chapter.

New event system

We've updated Behat to use the new EventDispatcher component, which comes to Symfony2 from Doctrine2. It's based on OOP principles and helps to clean up the event API a little bit more. This means that, from now on, you don't need to read documentation to understand what you're able to do with your $event object inside hooks - just look at the event types API.

Hooks documentation updated accordingly.

Named regex matchers in step definitions

With new regex matching mechanics, both:

<?php

$steps->Given(
    '/^(?P<arg2>d+) and (?P<arg1>d+)$/',
    function($world, $arg2, $arg1) {
        ...
    });

and

<?php

$steps->Given(
    '/^(?P<arg2>d+) and (?P<arg1>d+)$/',
    function($world, $arg1, $arg2) {
        ...
    });

are now equals unless you change the parameter or regex matchers names. In addition to the default "ordered" arguments mapping technique, Behat is now able to understand named arguments and map them to proper callback arguments. This greatly simplifies the maintenance process, especially when translating definitions ;-)

Read new section in steps documentation.

Japanese translation

Thanks to our great community, and particulary Hidenori Goto we now have japanese translation for Behat foramtters. Keep it up! Behat can/should talk in your native language!

More big news

Keep in touch. We will have more great news for you in the coming hours ;-)

Written by

KNP Labs
KNP Labs

Comments