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

ActiveLibrary

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

Helpers for writing better Kernel and Unit tests for Drupal

1.0.4(1y ago)104.6k↓50%2[2 issues](https://github.com/mglaman/drupal-test-helpers/issues)3MITPHPPHP ^8.1CI passing

Since Oct 8Pushed 1y 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 1mo ago

READMEChangelog (5)Dependencies (11)Versions (8)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

40

—

FairBetter than 88% of packages

Maintenance43

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

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

398d 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)")

###  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

[farmos/farmos

A web-based farm record keeping application.

1.2k6.7k1](/packages/farmos-farmos)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)

PHPackages © 2026

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