This may take a while, go and get a cup of coffee it'll get exciting soon. Sudo composer global require ciaranmcnulty/behat-stepthroughextension dev-masterįinally, get composer to install (or update) all the required components: sudo composer global update Sudo composer global require drush/drush ~7.0 Sudo composer global require feature-browser/feature-browser ~1.0 Sudo composer global require drupal/drupal-extension ~3.0 Next we are telling composer which components we do require for our test environment: sudo composer global require behat/behat ~3.0.15 Just to make sure that your composer is properly updated and as current as possible you should run sudo composer self-updateĮspecially if it was already installed on your system. This is optional and only required if composer is not yet installed on your system: sudo curl -s | sudo php The command line instructions have been tested on Ubuntu 15.04 but should be more or less the same for other platforms too. Here is a step by step instruction on how to get all the components installed. Last but not least, the Behat integration into PhpStorm also works really nice so that everything got integrated nicely and turned out to be a perfect fit for our working environment. ![]() The fact that we intended to test Drupal projects only and that there is a well maintained Drupal extension for Behat around that also integrates Drush into the framework made the choice quite easy and none of the tests with any of the three platforms brought up any huge arguments for one of the others. ![]() The preference has been on PHP at first and looking around at possible frameworks, PhpSpec, Codeception and Behat turned out to be great candidates for the job. In fact, I'd be interested in learning about them. So, the below tutorial reflects my very own and personally preferred way of utilizing those great tools and I'd never be surprised if anyone came up with some different ways of doing it. ![]() The requirement for this additional post was driven by my own experience that an efficient setup, test architecture and automation has not yet been described from start to end. There are plenty of articles, tutorials and blog posts available on this same topic and you will find some of the links below. The purpose of this blog post is to demonstrate some best practices for testing Drupal projects with Behat for developers using PhpStorm (or any equivalent IDE from JetBrains like e.g. And to cut a long story short: BDD (behaviour driven development) can deliver a significant part in both of these areas. However, the bigger my projects tend to get and the longer they last, the more this becomes a real issue so that even the developer in me starts to promote the idea of proper testing and documentation. Developers are known for their most famous topics to be testing and documentation - not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |