{"id":57,"date":"2011-07-26T14:52:45","date_gmt":"2011-07-26T13:52:45","guid":{"rendered":"http:\/\/blogs.kent.ac.uk\/webdev\/?p=57"},"modified":"2011-07-26T14:53:44","modified_gmt":"2011-07-26T13:53:44","slug":"migrating-to-behat-2-x","status":"publish","type":"post","link":"https:\/\/blogs.kent.ac.uk\/webdev\/2011\/07\/26\/migrating-to-behat-2-x\/","title":{"rendered":"Migrating to Behat 2.x"},"content":{"rendered":"<p>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.<\/p>\n<p>The tests are written using <a title=\"Behat\" href=\"http:\/\/behat.org\/\">Behat<\/a>, a <a title=\"What's in a story?\" href=\"http:\/\/dannorth.net\/whats-in-a-story\/\">BDD <\/a>testing system, which I didn&#8217;t have in my stack. After following the <a title=\"Quick introduction\" href=\"http:\/\/docs.behat.org\/quick_intro.html\">quick introduction<\/a>, and an install using <a title=\"Pear\" href=\"http:\/\/pear.php.net\/\">pear <\/a>later and I have behat. \\o\/\u00a0 Type the command behat and all should be good, no? Not at all. I get many many warnings.<\/p>\n<p>It turns out that since the original program was written Behat has been upgraded from 1.x to 2.x. Fortunately there is<a title=\"Migrating from Behat 1.x to 2.x\" href=\"http:\/\/docs.behat.org\/cookbook\/migrate_from_1x_to_20.html\"> an excellent article<\/a> on the Behat website on how to migrate from 1.x to 2.x whilst still leaving your version 1 files in place.<\/p>\n<p>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 <a title=\"FeatureContext\" href=\"http:\/\/http:\/\/docs.behat.org\/guides\/4.context.html\">FeatureContext<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/blogs.kent.ac.uk\/webdev\/2011\/07\/26\/migrating-to-behat-2-x\/\">Read&nbsp;more<\/a><\/p>\n","protected":false},"author":62,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1464,1],"tags":[8960,8953,8947],"_links":{"self":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/57"}],"collection":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":4,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/57\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}