PHPackages                             vmpublishing/psr15-middleware-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. vmpublishing/psr15-middleware-test-helpers

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

vmpublishing/psr15-middleware-test-helpers
==========================================

couple of often reused mocks for testing psr-15 middlewares

1.0.4(7y ago)01613MITPHPPHP &gt;=7.2

Since Jun 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vmpublishing/psr15-middleware-test-helpers)[ Packagist](https://packagist.org/packages/vmpublishing/psr15-middleware-test-helpers)[ RSS](/packages/vmpublishing-psr15-middleware-test-helpers/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (6)Used By (3)

[![Code Coverage](https://camo.githubusercontent.com/fde1a3ea1fa6d66244ad30e0082c3769ad145042cc370ebc5d588295d05208e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f766d7075626c697368696e672f70737231352d6d6964646c65776172652d746573742d68656c706572732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vmpublishing/psr15-middleware-test-helpers/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/85b851db9dc5779d8413e96cd40b7105e47a9738b63a528fbb4c916757ea6cf6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f766d7075626c697368696e672f70737231352d6d6964646c65776172652d746573742d68656c706572732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vmpublishing/psr15-middleware-test-helpers/?branch=master)[![Build Status](https://camo.githubusercontent.com/a8ecf88f3879f4be715ed3ec8cf0334daf4de259619313cdec5c272dbec92e35/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f766d7075626c697368696e672f70737231352d6d6964646c65776172652d746573742d68656c706572732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vmpublishing/psr15-middleware-test-helpers/build-status/master)

**WHAT**

a collection of reusable mocks for phpunit for the common middleware-related interfaces

**INSTALL**

To install simply use `composer require vmpublishing/psr15-middleware-test-helpers`

**USE**

As these are traits, just use them inside your testcase:

```

class SomeTest extends TestCase
{
    use VM\Psr15Mocks\Middleware; // include to use
    // this will generate the member variables:
    // $request
    // $response
    // $requestHandler
    // $body

    // ..

    // create them all properly
    public function setUp(): void
    {
        $this->buildResponse();
        $this->buildRequest();
        $this->buildRequestHandler();
        $this->buildBody();
    }

    // destroy them all properly
    public function tearDown(): void
    {
        $this->destroyBody();
        $this->destroyRequestHandler();
        $this->destroyRequest();
        $this->destroyResponse();
    }

    // ..

    public function testSomething(): void
    {
        // use to validate calls
        $this->response->expects($this->once())->method('getBody')->willReturn($this->body);
    }
}

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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 ~1 days

Total

5

Last Release

2570d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.3

1.0.4PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1516466?v=4)[verticalmedia](/maintainers/verticalmedia)[@verticalmedia](https://github.com/verticalmedia)

### Embed Badge

![Health badge](/badges/vmpublishing-psr15-middleware-test-helpers/health.svg)

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

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k41.3M39.1k](/packages/orchestra-testbench)[drupal/core-dev

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

2022.0M322](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30300.1k7](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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