PHPackages                             tomkyle/mock-psr - 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. tomkyle/mock-psr

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

tomkyle/mock-psr
================

Mock common PSR standard components in PhpUnit tests

1.8.0(1y ago)03.2k—3.3%1MITPHPPHP ^8.3CI passing

Since Sep 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tomkyle/mock-psr)[ Packagist](https://packagist.org/packages/tomkyle/mock-psr)[ RSS](/packages/tomkyle-mock-psr/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (15)Versions (22)Used By (1)

tomkyle · Mock PSR
==================

[](#tomkyle--mock-psr)

**Effortless PHPUnit mocks for common PSR interfaces – no more boilerplate, just clean tests.**

[![Packagist](https://camo.githubusercontent.com/83dad3ce4ba7b1a5eee2254bf96e919bf839afd6f8107bbc392576eb0302cbfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6d6b796c652f6d6f636b2d7073722e7376673f7374796c653d666c6174)](https://packagist.org/packages/tomkyle/mock-psr)[![PHP version](https://camo.githubusercontent.com/7c18af8b67785c79b094381e575b666eadec1a87bf725ba027949f08135ed0de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f6d6b796c652f6d6f636b2d7073722e737667)](https://packagist.org/packages/tomkyle/mock-psr)[![PHP Composer](https://github.com/tomkyle/mock-psr/actions/workflows/php.yml/badge.svg)](https://github.com/tomkyle/mock-psr/actions/workflows/php.yml)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

---

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

[](#installation)

```
$ composer require --dev tomkyle/mock-psr
```

Usage
-----

[](#usage)

This library provides two ways to use the PSR mocking functionality:

### Option 1: Individual Traits

[](#option-1-individual-traits)

Each PSR standard has its own trait that can be used independently in your test classes:

```
