PHPackages                             dpi/enhanced-drupal-phpunit-results - 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. dpi/enhanced-drupal-phpunit-results

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

dpi/enhanced-drupal-phpunit-results
===================================

0.2.0(3y ago)14.0k1[2 PRs](https://github.com/dpi/enhanced-drupal-phpunit-results/pulls)BSD-3-ClausePHPPHP ^8

Since Jun 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dpi/enhanced-drupal-phpunit-results)[ Packagist](https://packagist.org/packages/dpi/enhanced-drupal-phpunit-results)[ RSS](/packages/dpi-enhanced-drupal-phpunit-results/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (2)Dependencies (9)Versions (5)Used By (0)

Enhanced Drupal PHPUnit Results
===============================

[](#enhanced-drupal-phpunit-results)

[![Codecov](https://camo.githubusercontent.com/96ccdad16ef673a3f5d7d930f08a6e2a32c1a95e2a8dd5716164a2c834f7ccaa/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6470692f656e68616e6365642d64727570616c2d706870756e69742d726573756c7473)](https://app.codecov.io/gh/dpi/enhanced-drupal-phpunit-results)[![GitHub branch checks state](https://camo.githubusercontent.com/4aa391ece52d1c08625ccf3f480210edfa75229d5bac02476a4190ec5b537bcf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636865636b732d7374617475732f6470692f656e68616e6365642d64727570616c2d706870756e69742d726573756c74732f312e78)](https://github.com/dpi/enhanced-drupal-phpunit-results/actions)[![License](https://camo.githubusercontent.com/47e8247bf405aebd9abf905db430dcd40d47c5e2cc6bf6eaec6dbd1f07dfce07/687474703a2f2f706f7365722e707567782e6f72672f6470692f656e68616e6365642d64727570616c2d706870756e69742d726573756c74732f6c6963656e7365)](https://packagist.org/packages/dpi/enhanced-drupal-phpunit-results)

Provides tooling to improve the output of PHPUnit tests with Drupal.

**After**

[![Spotlight After](docs/after.png)](docs/after.png)

**Before**

[![Spotlight Before](docs/before.png)](docs/before.png)

**Highlights**

- Command-click/control click URL to open artifact in web browser.
- Command-click/control click file+line to open in IDE (PHPStorm / VSCode / MacVim / Emacs / Sublime Text / Textmate)
- The URL fetched is shown.
- `drupalGet`/`drupalLogin`/`drupalLogout`/`htmlOutput`/`submitForm` page loads are detected,
- Icon shown indicating whether artifact is associated with a page load: 📄 `drupalGet` 🛂 `drupalLogin` 🥾 `drupalLogout` ⚡️ `htmlOutput` 🖍 `submitForm`
- Test method is green or red depending on test pass/failure.
- Execution stack is shown between the test method and the point of page load.
- For direct invocations of page load from a test, a short stack is shown.

The project is intended for use with functional tests, specifically projects utilizing [Drupal Test Traits](https://gitlab.com/weitzman/drupal-test-traits). Its recommended to utilize `phpunit --printer` or create a new `phpunit.xml` to separate Kernel and Unit tests.

Tests will need to use the included trait. Out of the box this enhancement cannot be used with tests out of your control, unless base test classes are patched, such as `\Drupal\Tests\BrowserTestBase`.

*Drupal is a registered trademark of Dries Buytaert.*

Installation and setup
----------------------

[](#installation-and-setup)

```
composer require dpi/enhanced-drupal-phpunit-results
```

In PHPUnit configuration files such as `phpunit.xml`, `phpunit.xml.dist`, etc, modify printerClass to reference the class from this library:

```

```

In base test files, replace `use \Drupal\Tests\UiHelperTrait` with `use \dpi\EnhancedDrupalPhpunitResults\CombinedEnhancedUiHelperTrait`.

Or if there are collisions,

```
use EnhancedUiHelperTrait {
    EnhancedUiHelperTrait::htmlOutput insteadof UiHelperTrait;
}
```

Configuration
-------------

[](#configuration)

Optional configuration is available.

Set these values as environment variables in the executor or phpunit.ini file.

### IDE launch links

[](#ide-launch-links)

Will trigger control/command-clicks on file paths to open in an editor of choice.

Possible values:

- `emacs`
- `macvim`
- `phpstorm`
- `sublime`
- `textmate`
- `vscode`

`export ENHANCED_RESULTS_IDE=phpstorm`

```

```

[![IDE Launch Links](docs/ide.png)](docs/ide.png)

### Repeat context

[](#repeat-context)

Will repeat the executing test at the top of the stack. Normally the executed test is only printed once at the beginning. This option will print the test in context for each drupalGet at the top of the stack. This is useful for tests with many drupalGets.

`export ENHANCED_RESULTS_USE_REPEAT_CONTEXT=TRUE`

```

```

[![IDE Launch Links](docs/repeatcontext.png)](docs/repeatcontext.png)

### Disable trimming columns to terminal width

[](#disable-trimming-columns-to-terminal-width)

Disable trimming file and URL text strings to terminal width. Instead strings will display untruncated.

`export ENHANCED_RESULTS_DISABLE_TRIM_COLUMNS=TRUE`

```

```

### Disable stacks

[](#disable-stacks)

Disable long stacks if they are noisy

`export ENHANCED_RESULTS_DISABLE_OUTPUT_STACK=TRUE`

```

```

[![IDE Launch Links](docs/notruncation.png)](docs/notruncation.png)

### Use sequential IDS instead of artifact numbers

[](#use-sequential-ids-instead-of-artifact-numbers)

Display numbers next to each drupalGet, starting from 1, relative to the current test run. Instead of artifact numbers.

`export ENHANCED_RESULTS_USE_SEQUENTIAL_IDS=TRUE`

```

```

### Change file prefix

[](#change-file-prefix)

Changes file prefix so clickable files work, useful when used with Docker mounts or symlinks.

`export ENHANCED_RESULTS_FILE_PREFIX=/home/user/www`

```

```

Other notes
===========

[](#other-notes)

- Utilize Drupal's builtin `BROWSERTEST_OUTPUT_BASE_URL` if artifacts are accessed by a different URL by the host OS, than the test runner. This helps to resolve issues with incorrect clickable artifact URLs.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~6 days

Total

3

Last Release

1419d ago

Major Versions

0.2.0 → 1.x-dev2022-06-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a8e9cf072797a1662cbb1cb98e9a1d5e6eac6c5c4d798365a9f715bb6a67d0c?d=identicon)[dpi](/maintainers/dpi)

---

Top Contributors

[![dpi](https://avatars.githubusercontent.com/u/21850?v=4)](https://github.com/dpi "dpi (10 commits)")[![acbramley](https://avatars.githubusercontent.com/u/569927?v=4)](https://github.com/acbramley "acbramley (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dpi-enhanced-drupal-phpunit-results/health.svg)

```
[![Health](https://phpackages.com/badges/dpi-enhanced-drupal-phpunit-results/health.svg)](https://phpackages.com/packages/dpi-enhanced-drupal-phpunit-results)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[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)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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