PHPackages                             maks3w/psr7-assertions - 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. maks3w/psr7-assertions

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

maks3w/psr7-assertions
======================

Test your library conformance with PSR-7

17862PHP

Since Apr 16Pushed 10y ago2 watchersCompare

[ Source](https://github.com/Maks3w/Psr7Assertions)[ Packagist](https://packagist.org/packages/maks3w/psr7-assertions)[ RSS](/packages/maks3w-psr7-assertions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PSR-7 Assertions
================

[](#psr-7-assertions)

[![Build Status](https://camo.githubusercontent.com/d99c3da5561707d373bba80eff6666aff61cb6071ccd4e36e9194bd38ea6da2d/68747470733a2f2f7472617669732d63692e6f72672f4d616b7333772f50737237417373657274696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Maks3w/Psr7Assertions)[![Coverage Status](https://camo.githubusercontent.com/259f4a20bda6093afb32b36b68ea808724d45b52583c60ac833eaf1e53476947/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4d616b7333772f50737237417373657274696f6e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/Maks3w/Psr7Assertions?branch=master)

Test if your HTTP messages are compliant with the [PSR-7 (HTTP message interfaces) specification](http://www.php-fig.org/psr/psr-7/).

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org) to install this library:

```
composer require maks3w/psr7-assertions
```

Usage in PHPUnit
----------------

[](#usage-in-phpunit)

`Psr7Assertions` provides following traits with helper functions for asserting interface constraints:

- [MessageInterfaceTestsTrait](src/PhpUnit/MessageInterfaceTestsTrait.php) for testing `MessageInterface` implementations.
- [RequestInterfaceTestsTrait](src/PhpUnit/RequestInterfaceTestsTrait.php) for testing `RequestInterface` implementations.
- [ResponseInterfaceTestsTrait](src/PhpUnit/ResponseInterfaceTestsTrait.php) for testing `ResponseInterface` implementations.
- [ServerRequestInterfaceTestsTrait](src/PhpUnit/ServerRequestInterfaceTestsTrait.php) for testing `ServerRequestInterface` implementations.

See examples at [example/PhpUnit](example/PhpUnit).

License
-------

[](#license)

Code licensed under BSD 2 clauses terms &amp; conditions.

See [LICENSE.txt](LICENSE.txt) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/19fdc97ccc21fe2689824d70ab378dfd2364433eeaca3e9b321beeb68eb79106?d=identicon)[Maks3w](/maintainers/Maks3w)

---

Top Contributors

[![Maks3w](https://avatars.githubusercontent.com/u/1301698?v=4)](https://github.com/Maks3w "Maks3w (18 commits)")[![mtymek](https://avatars.githubusercontent.com/u/777893?v=4)](https://github.com/mtymek "mtymek (1 commits)")

### Embed Badge

![Health badge](/badges/maks3w-psr7-assertions/health.svg)

```
[![Health](https://phpackages.com/badges/maks3w-psr7-assertions/health.svg)](https://phpackages.com/packages/maks3w-psr7-assertions)
```

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