PHPackages                             behat/debug-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. behat/debug-extension

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

behat/debug-extension
=====================

Debug Behat scenarios and print any information to command line

1.0(10y ago)1119.3k—5.8%2MITPHPPHP &gt;=5.5

Since May 9Pushed 10y agoCompare

[ Source](https://github.com/BR0kEN-/behat-debug-extension)[ Packagist](https://packagist.org/packages/behat/debug-extension)[ Docs](https://github.com/BR0kEN-/behat-debug-extension)[ RSS](/packages/behat-debug-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (2)Used By (2)

Behat Debug Extension
=====================

[](#behat-debug-extension)

Print any information you'd like to a command line during the test suite execution.

[![Build Status](https://camo.githubusercontent.com/428c3db06c40b44e050f0ed3d9aac0c9f48bac5cd00f140a319e0a6b73aa9aa5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4252306b454e2d2f62656861742d64656275672d657874656e73696f6e2f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/BR0kEN-/behat-debug-extension)[![Coverage Status](https://camo.githubusercontent.com/fb27ae7da205d47858ece3bbc4b6573179536a095a4dc150ce5e95dca4e113c0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4252306b454e2d2f62656861742d64656275672d657874656e73696f6e2e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/BR0kEN-/behat-debug-extension/code-structure)[![Quality Score](https://camo.githubusercontent.com/3b2c700d67c2abb2c3b7621e3450209a1f73626542f58033db7d7fb044805403/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4252306b454e2d2f62656861742d64656275672d657874656e73696f6e2e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/BR0kEN-/behat-debug-extension)[![Total Downloads](https://camo.githubusercontent.com/52f33db166dc3d773306e4bd0e7ed35788422c26cdd99ced79f09652aef2b6d4/68747470733a2f2f706f7365722e707567782e6f72672f62656861742f64656275672d657874656e73696f6e2f646f776e6c6f616473)](https://packagist.org/packages/behat/debug-extension)[![Latest Stable Version](https://camo.githubusercontent.com/08417b9f6f1330e7dd683c1cba5e7417a7c64cfd876ecf08bc4fae305fa53b63/68747470733a2f2f706f7365722e707567782e6f72672f62656861742f64656275672d657874656e73696f6e2f762f737461626c65)](https://packagist.org/packages/behat/debug-extension)[![License](https://camo.githubusercontent.com/6dcfdbb8790102d34c09a31ce9f908ad0a8464407ba427c2a9393c8c122b646d/68747470733a2f2f706f7365722e707567782e6f72672f62656861742f64656275672d657874656e73696f6e2f6c6963656e7365)](https://packagist.org/packages/behat/debug-extension)

Usage
-----

[](#usage)

Add `@debug` tag to your feature definition:

```
@debug
Feature: Test

  Scenario: Test
  # ...
```

Add extension to your configuration file:

```
default:
  extensions:
    Behat\DebugExtension: ~
```

Extend your object with a trait:

```
use Behat\DebugExtension\Debugger;

class Example
{
    use Debugger;
}
```

Use the `debug` method wherever you like:

```
public function method()
{
    // ...
    self::debug([
        'Function arguments: %s',
        'Second line',
    ], [
        var_export(func_get_args(), true),
    ]);
    // ...
}
```

As you can see the `debug` method processed by `sprintf()` function, so second argument for a method is an array of placeholders.

### Messages

[](#messages)

Also, with this extension, you able to print styled messages to a command line.

```
new \Behat\DebugExtension\Message('comment', 2, [
    'This is a first line of a message that will be printed to a command line.',
    'Read documentation for this class to know how to use it.',
]);
```

### Programmatic usage

[](#programmatic-usage)

```
export BEHAT_DEBUG=true
```

This environment variable tells that messages should be printed in any way.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

3707d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e8b4c73b9ba0729e2c5b690cbdb63bfbe982130513b0c9d64c6c26e1d4d32ff?d=identicon)[BR0kEN-](/maintainers/BR0kEN-)

---

Top Contributors

[![BR0kEN-](https://avatars.githubusercontent.com/u/2760616?v=4)](https://github.com/BR0kEN- "BR0kEN- (11 commits)")

---

Tags

bddbehatbehat-extensiontddtestingdebugdebuggerBehatservices

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/behat-debug-extension/health.svg)

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

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.7M173](/packages/drupal-drupal-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[imbo/behat-api-extension

API extension for Behat

1092.6M9](/packages/imbo-behat-api-extension)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.9M54](/packages/dvdoug-behat-code-coverage)[sensiolabs/behat-page-object-extension

Page object extension for Behat

1166.7M29](/packages/sensiolabs-behat-page-object-extension)[drevops/behat-steps

Collection of steps for Behat

27431.3k4](/packages/drevops-behat-steps)

PHPackages © 2026

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