Migrating to Behat 2.x

Today I needed to pick up a project that a colleague had written and make modifications. Like a good developer should, he had written tests to go along with his code, so the first thing I needed to do was to make sure that they all pass before I do anything to the codebase.

The tests are written using Behat, a BDD testing system, which I didn’t have in my stack. After following the quick introduction, and an install using pear later and I have behat. \o/  Type the command behat and all should be good, no? Not at all. I get many many warnings.

It turns out that since the original program was written Behat has been upgraded from 1.x to 2.x. Fortunately there is an excellent article on the Behat website on how to migrate from 1.x to 2.x whilst still leaving your version 1 files in place.

This is usefull as it allows your colleagues who are still using 1.x to carry on testing the code, whilst you can seperate 2.x specific items away in the FeatureContext.

Leave a Reply

Your email address will not be published.