PHPackages                             mglaman/drupal-test-helpers - 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. mglaman/drupal-test-helpers

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

mglaman/drupal-test-helpers
===========================

Helpers for writing better Kernel and Unit tests for Drupal

1.0.4(1y ago)105.1k↑275%2[2 issues](https://github.com/mglaman/drupal-test-helpers/issues)3MITPHPPHP ^8.1CI failing

Since Oct 8Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/mglaman/drupal-test-helpers)[ Packagist](https://packagist.org/packages/mglaman/drupal-test-helpers)[ RSS](/packages/mglaman-drupal-test-helpers/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (5)Dependencies (11)Versions (9)Used By (3)

drupal-test-helpers
===================

[](#drupal-test-helpers)

Helpers for writing better Kernel and Unit tests for Drupal

Traits
======

[](#traits)

The following traits are provided by this library for tests

RequestTrait
------------

[](#requesttrait)

Provides methods to assert requests and responses within Kernel tests.

```
final class RequestTraitTest extends KernelTestBase
{
    use RequestTrait;

    /**
     * @var string[]
     */
    protected static $modules = ['system', 'user'];

    public function testDoRequest(): void
    {
        $this->installConfig(['system']);
        $this->doRequest(Request::create('/user/login'));
        self::assertStringContainsString(
            'Enter your  username.',
            $this->getRawContent()
        );
    }
}
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance63

Regular maintenance activity

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~230 days

Total

5

Last Release

444d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c03d4d2a6aa9b5ecdfc565e8f90f53f0a8f6c2757048a148b34b166d78266c?d=identicon)[mglaman](/maintainers/mglaman)

---

Top Contributors

[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (14 commits)")[![claudiu-cristea](https://avatars.githubusercontent.com/u/473868?v=4)](https://github.com/claudiu-cristea "claudiu-cristea (1 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mglaman-drupal-test-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/mglaman-drupal-test-helpers/health.svg)](https://phpackages.com/packages/mglaman-drupal-test-helpers)
```

###  Alternatives

[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M420](/packages/drupal-core-recommended)

PHPackages © 2026

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