PHPackages                             adamquaile/behat-command-runner-extension - 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. adamquaile/behat-command-runner-extension

ActiveLibrary[Testing &amp; Quality](/categories/testing)

adamquaile/behat-command-runner-extension
=========================================

Extension to run commands at hooks in test lifecycle

v0.1.1(11y ago)14183.6k↓28.6%4PHP

Since Oct 2Pushed 5y ago2 watchersCompare

[ Source](https://github.com/adamquaile/behat-command-runner-extension)[ Packagist](https://packagist.org/packages/adamquaile/behat-command-runner-extension)[ RSS](/packages/adamquaile-behat-command-runner-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (4)

Behat Command Runner extension
==============================

[](#behat-command-runner-extension)

*This is a proof-of-concept - use with caution!*

Extension to run commands at hooks in test lifecycle, useful for cache clearing, database setup, teardown, etc...

Installation
------------

[](#installation)

Require package `adamquaile/behat-command-runner-extension` via composer:

```
composer require --dev "adamquaile/behat-command-runner-extension *@dev"

```

Add configuration to your `behat.yml`. This example shows the full configuration options.

```
default:
    extensions:
        AdamQuaile\Behat\CommandRunnerExtension:
              beforeSuite:
                  - echo "beforeSuite"
                  - { command: 'ping example.com', background: true }
              afterSuite:
                  - echo "afterSuite"
              beforeFeature:
                  - echo "beforeFeature"
                  - { command: 'ping example.com', background: true }
              afterFeature:
                  - echo "afterFeature"
              beforeScenario:
                  - echo "beforeScenario"
                  - { command: 'ping example.com', background: true }
              afterScenario:
                  - echo "afterScenario"

```

A symfony2 example
------------------

[](#a-symfony2-example)

This example runs `phantomjs` for our javascript behat tests, and also creates and recreates a test database for each feature.

For speed, the database is copied back into place after the first run during setup rather than using doctrine each time.

For more isolation, you could do this copying on `beforeScenario` rather than `beforeFeature`.

```
default:
    extensions:
        AdamQuaile\Behat\CommandRunnerExtension:
              beforeSuite:
                  - rm app/var/test.db
                  - php app/console --env=test doctrine:database:drop --force
                  - php app/console --env=test doctrine:database:create --force
                  - php app/console --env=test doctrine:schema:update --force
                  - cp app/var/test.db app/var/test.initial.db
                  - { command: 'phantomjs-1.9.7-linux-x86_64/bin/phantomjs" --webdriver=4444  >"phantomjs.log"', background: true }
              beforeFeature:
                  - cp app/var/test.initial.db app/var/test.db

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4247d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/69929?v=4)[Adam Quaile](/maintainers/adamquaile)[@adamquaile](https://github.com/adamquaile)

---

Top Contributors

[![adamquaile](https://avatars.githubusercontent.com/u/69929?v=4)](https://github.com/adamquaile "adamquaile (7 commits)")[![NafaaAzaiez](https://avatars.githubusercontent.com/u/8181906?v=4)](https://github.com/NafaaAzaiez "NafaaAzaiez (3 commits)")

### Embed Badge

![Health badge](/badges/adamquaile-behat-command-runner-extension/health.svg)

```
[![Health](https://phpackages.com/badges/adamquaile-behat-command-runner-extension/health.svg)](https://phpackages.com/packages/adamquaile-behat-command-runner-extension)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

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

Simple parallel testing execution... with some goodies for functional tests.

4825.6M26](/packages/liuggio-fastest)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M446](/packages/friends-of-behat-variadic-extension)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[orchestra/workbench

Workbench Companion for Laravel Packages Development

8217.0M43](/packages/orchestra-workbench)[drupal/drupal-driver

A collection of reusable Drupal drivers

6715.8M18](/packages/drupal-drupal-driver)

PHPackages © 2026

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