Skip to main content

Behat Drupal Extension System-wide installation

Earlier in stand alone installation we installed composer and behat to specific project directory and our commands were limited to that directory only. In this video we will do System Wide installation. A system-wide installation allows you to maintain a single copy of the testing tool set and use it for multiple test environments. Configuration is slightly more complex than the stand-alone installation but many people prefer the flexibility and ease-of-maintenance this setup provides.

Step 1: Install Composer. 

$ curl -sS https://getcomposer.org/installer |
$ php mv composer.phar /usr/local/bin/composer

Step 2: Install the Drupal Extension:

$ cd /opt/
$ sudo mkdir drupalextension
$ cd drupalextension/

Step 3: Inside drupal extension folder create a file called composer.json and paste below code:

{
  "require": {
    "drupal/drupal-extension": "^3.2"
  },
  "config": {
    "bin-dir": "bin/"
  }
}

Step 4: Run composer composer install command. 

$ composer install

Step 5: Check the installation works by typing below command.

$ bin/behat --help

If you were successful, you’ll see the help output.

Step 6: Make the binary available system-wide

$ ln -s /opt/drupalextension/bin/behat /usr/local/bin/behat

Step 7: Check behat outside folder

$ behat --version

Submitted by tgoswami on November 6, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.