PHPackages                             boga881/drupal-spec-tool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. boga881/drupal-spec-tool

ActiveBehat-extension[Testing &amp; Quality](/categories/testing)

boga881/drupal-spec-tool
========================

A tool for specifying Drupal architecture details and generating automated tests for them

086Gherkin

Since Feb 15Pushed 3y agoCompare

[ Source](https://github.com/boga881/drupal-spec-tool)[ Packagist](https://packagist.org/packages/boga881/drupal-spec-tool)[ RSS](/packages/boga881-drupal-spec-tool/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Drupal Spec Tool
================

[](#drupal-spec-tool)

[![Packagist](https://camo.githubusercontent.com/57e63937de0c38bbc79b57afaf77abb857279d6a940efe45555aae8323837d75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6163717569612f64727570616c2d737065632d746f6f6c2e737667)](https://packagist.org/packages/acquia/drupal-spec-tool)[![Tests](https://github.com/acquia/drupal-spec-tool/actions/workflows/orca.yml/badge.svg)](https://github.com/acquia/drupal-spec-tool/actions/workflows/orca.yml)

This project provides a tool for specifying Drupal architecture details and generating automated tests for them. It consists of 1) [a Google Sheet](#google-sheet) for capturing specification and generating tests from it and 2) the Behat contexts that automate the generated tests ([examples](../features)).

Getting started
---------------

[](#getting-started)

### Google sheet

[](#google-sheet)

Copy [the current Google sheet](https://docs.google.com/spreadsheets/d/1pVQNyE5Rqhdnzk-6dHN5nnH_FsGfjub2_bzQF5MewSs/edit?usp=sharing) to your Google Drive:

[![Google Sheet Screenshot](images/screenshot.png)](images/screenshot.png)

### Behat tests

[](#behat-tests)

Assuming you already have [Behat installed](http://behat.org/en/latest/quick_start.html#installation) via [Composer](https://getcomposer.org/)...

1. Install the Behat contexts:

    ```
    composer require --dev acquia/drupal-spec-tool
    ```
2. Add the new contexts to your [Behat configuration](http://behat.org/en/latest/user_guide/configuration.html), e.g.:

    ```
    # behat.yml
    default:
      suites:
        default:
          contexts:
            - Acquia\DrupalSpecTool\Context\AccessControlContext
            - Acquia\DrupalSpecTool\Context\ContentModelContext
            - Acquia\DrupalSpecTool\Context\MediaContext
            - Acquia\DrupalSpecTool\Context\MenuContext
            - Acquia\DrupalSpecTool\Context\ViewsContext
            - Acquia\DrupalSpecTool\Context\WorkflowContext
    ```
3. Copy [the default feature files](../features) (representing the out-of-the-box configuration of Lightning) to your features directory. For example, given a [BLT](https://github.com/acquia/blt-behat)-based project:

    ```
    mkdir -p tests/behat/features/drupal-spec-tool
    cp vendor/acquia/drupal-spec-tool/features/*.feature tests/behat/features/drupal-spec-tool/
    ```
4. As you change the specification, update the features to match using the generated Gherkin on the "Behat" tab of the Google sheet. (See [Advanced](#advanced) below to automate this process.)
5. Run Behat! If the tests pass, your application matches the specification. If not, change one or the other according to your needs.

Usage
-----

[](#usage)

Learn more about the features of the tool and best practices for using it in [the announcement blog post on the Acquia Developer Center](https://dev.acquia.com/blog/a-specification-tool-for-drupal-8-/30/05/2018/19606).

Customization
-------------

[](#customization)

You can supplement or override out-of-the-box behavior by extending and replacing the default context classes with your own, e.g.:

```
namespace AcmeCorp;

class CustomContentModelContext extends Acquia\DrupalSpecTool\Context\ContentModelContext {

  /**
   * Override existing functionality.
   *
   * @Then exactly the following content entity type bundles should exist
   */
  public function assertBundles(TableNode $expected) {
    // ...
  }

  /**
   * Add new functionality.
   *
   * @Then something new should be true
   */
  public function assertSomethingNew(TableNode $expected) {
    // ...
  }

}
```

```
 # behat.yml
 default:
   suites:
     default:
       contexts:
-        - Acquia\DrupalSpecTool\Context\ContentModelContext
+        - AcmeCorp\CustomContentModelContext
```

Supporting tools
----------------

[](#supporting-tools)

The community has provided tools to build on the Drupal Spec Tool:

- [Drupal Spec Tool Commands](https://packagist.org/packages/nickwilde1990/drupal-spec-tool-commands) - Provides commands to automatically update the Google Sheet to match an existing Drupal site. This is helpful for adding the Drupal Spec Tool on a pre-existing project.
- [Drupal Entity Generator (DEG)](https://drupal-entity-generator.readthedocs.io/) - Automatically generates Drupal configuration based on the Google Sheet, i.e., go "the other way" and updates your Drupal site to match your specification.

Known issues
------------

[](#known-issues)

[See open bug reports in the issue queue.](https://github.com/acquia/drupal-spec-tool/labels/bug)

Contribution
------------

[](#contribution)

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

Copyright (C) 2018 Acquia, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b2935f9df8522b1eb3052ed4b423c8a2ff217b1fc945fb5125a81f9519a2d371?d=identicon)[boga881](/maintainers/boga881)

---

Top Contributors

[![TravisCarden](https://avatars.githubusercontent.com/u/959246?v=4)](https://github.com/TravisCarden "TravisCarden (145 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![jfarrell](https://avatars.githubusercontent.com/u/770483?v=4)](https://github.com/jfarrell "jfarrell (2 commits)")[![mxr576](https://avatars.githubusercontent.com/u/1755573?v=4)](https://github.com/mxr576 "mxr576 (1 commits)")[![secretsayan](https://avatars.githubusercontent.com/u/9529657?v=4)](https://github.com/secretsayan "secretsayan (1 commits)")[![mikemadison13](https://avatars.githubusercontent.com/u/22753451?v=4)](https://github.com/mikemadison13 "mikemadison13 (1 commits)")[![jhedstrom](https://avatars.githubusercontent.com/u/76833?v=4)](https://github.com/jhedstrom "jhedstrom (1 commits)")[![christopher-hopper](https://avatars.githubusercontent.com/u/452515?v=4)](https://github.com/christopher-hopper "christopher-hopper (1 commits)")

### Embed Badge

![Health badge](/badges/boga881-drupal-spec-tool/health.svg)

```
[![Health](https://phpackages.com/badges/boga881-drupal-spec-tool/health.svg)](https://phpackages.com/packages/boga881-drupal-spec-tool)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
