DBDD

Component ID

2076089

Component name

DBDD

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

DBDD: Drupal Behavior Driven Development.
"Conventions over configuration"

This module aim to provide conventions and tools to use Behavior Driven Development in a Drupal installation. It provides drush commands wrappers around testing frameworks binaries, such as behat or phpunit.

It is bundled with two submodules atm, dbdd_behat and dbdd_phpunit, which will be default binaries for stories and specs.

dbdd_behat

Tired of downloading behat or drupal extension manually with tools external to Drupal, for each and every projects ?

Just install and enable the module and everything will be configured for you !

  • drush dbdd-stories module_name|feature_path: run your activated story bdd tool (default to behat's drupal extension). If no option supplied, it parses sites/all/modules to find behat features, else with a module name it will look in the {module_path}/user_stories or you can supply the feature path relative to your Drupal root.
    An appropriate beyat.yml will be written to your Drupal root, you can override its settings by providing a dbdd_behat.yml which profiles will match drush aliases: by calling drush @website dbdd-stories, it is behat --profile=website that is really launched.

dbdd_phpunit

Work in progress.

  • drush dbdd-specs: run phpunit

How is it working ?

To achieve this, composer manager is used as a dependency so that composer.json are used to provide bdd tools installation.

DBDD submodules contains composer.json files: drupal extension (story bdd) and phpunit (spec bdd). When you enable one of them it does the configuration work you:

1 -) drush composer-manager update: update your composer dependencies so that bdd tools are installed.
2 -) drush dbdd-init: perform initialisation steps for your bdd tools every time dbdd-{stories|specs} is called.
For example, dbdd_behat initialisation writes the behat.yml file with your website configuration and the path to an appropriate FeatureContext class extending DrupalContext.

@TODO list:
1 - Self tests, ideally full bdd process.
2 - UI configuration (create user stories, choose between phpunit, simpletests, behat or others. Multilingual support).
3 - UI reports (stories and specs, failure, success).
4 - dbdd_phpunit implementation with drush dbdd-specs
5 - Simpletests support and phpspec Drupal extension.

DONE:
1 - multiple frameworks support
2 - Multisite setup support (managed with drush aliases and submodules dbdd-init implementations).