PHPackages                             laminas/laminas-container-config-test - 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. laminas/laminas-container-config-test

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

laminas/laminas-container-config-test
=====================================

Mezzio PSR-11 container configuration tests

1.2.0(8mo ago)550.1k↓17.1%6[2 issues](https://github.com/laminas/laminas-container-config-test/issues)[2 PRs](https://github.com/laminas/laminas-container-config-test/pulls)10BSD-3-ClausePHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Dec 31Pushed 1w ago12 watchersCompare

[ Source](https://github.com/laminas/laminas-container-config-test)[ Packagist](https://packagist.org/packages/laminas/laminas-container-config-test)[ Docs](https://laminas.dev)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/laminas-laminas-container-config-test/feed)WikiDiscussions 1.3.x Synced 2d ago

READMEChangelog (10)Dependencies (5)Versions (30)Used By (10)

laminas-container-config-test
=============================

[](#laminas-container-config-test)

[![Build Status](https://github.com/laminas/laminas-container-config-test/workflows/Continuous%20Integration/badge.svg)](https://github.com/laminas/laminas-container-config-test/actions?query=workflow%3A%22Continuous+Integration%22)

> ## 🇷🇺 Русским гражданам
>
> [](#-русским-гражданам)
>
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
>
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
>
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
>
> ## 🇺🇸 To Citizens of Russia
>
> [](#-to-citizens-of-russia)
>
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
>
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
>
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

This library provides common tests for PSR-11 containers configured using a subset of [laminas-servicemanager](https://github.com/laminas/laminas-servicemanager)[configuration](https://docs.laminas.dev/laminas-servicemanager/configuring-the-service-manager/)as [specified by Mezzio](https://docs.mezzio.dev/mezzio/v3/features/container/config/)

It guarantees delivery of the same basic functionality across multiple PSR-11 container implementations, and simplifies switching between them.

Currently we support:

- [Aura.Di](https://github.com/auraphp/Aura.Di) - via [laminas-auradi-config](https://github.com/laminas/laminas-auradi-config)
- [Pimple](https://pimple.symfony.com/) - via [laminas-pimple-config](https://github.com/laminas/laminas-pimple-config)
- [laminas-servicemanager](https://github.com/laminas/laminas-servicemanager)

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

[](#installation)

Run the following to install this library:

```
$ composer require --dev laminas/laminas-container-config-test
```

Using common tests
------------------

[](#using-common-tests)

In your library, you will need to extend the `Laminas\ContainerConfigTest\AbstractContainerTest` class within your test suite and implement the method `createContainer`:

```
protected function createContainer(array $config) : ContainerInterface;
```

It should return your PSR-11-compatible container, configured using `$config`.

Then, depending on what functionality you'd like to support, you can add the following traits into your test case:

- `Laminas\ContainerConfigTest\AliasTestTrait` - to support `aliases` configuration,
- `Laminas\ContainerConfigTest\DelegatorTestTrait` - to support `delegators` configuration,
- `Laminas\ContainerConfigTest\FactoryTestTrait` - to support `factories` configuration,
- `Laminas\ContainerConfigTest\InvokableTestTrait` - to support `invokables` configuration,
- `Laminas\ContainerConfigTest\ServiceTestTrait` - to support `services` configuration,
- `Laminas\ContainerConfigTest\SharedTestTrait` - to support `shared` and `shared_by_default` configuration.

To provide an Mezzio-compatible container, you should extend the class `Laminas\ContainerConfigTest\AbstractMezzioContainerConfigTest`and implement the method `createContainer`. This class composes the following traits:

- `Laminas\ContainerConfigTest\AliasTestTrait`,
- `Laminas\ContainerConfigTest\DelegatorTestTrait`,
- `Laminas\ContainerConfigTest\FactoryTestTrait`,
- `Laminas\ContainerConfigTest\InvokableTestTrait`,
- `Laminas\ContainerConfigTest\ServiceTestTrait`.

If you want also plan to support shared services, your test class should compose the `SharedTestTrait` as well:

```
use Laminas\ContainerConfigTest\AbstractMezzioContainerConfigTest;
use Laminas\ContainerConfigTest\SharedTestTrait;

class ContainerTest extends AbstractMezzioContainerConfigTest
{
    use SharedTestTrait;

    protected function createContainer(array $config) : ContainerInterface
    {
        // your container configuration
    }
}
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance73

Regular maintenance activity

Popularity37

Limited adoption so far

Community31

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~232 days

Total

27

Last Release

12d ago

Major Versions

0.9.x-dev → 1.0.02023-08-27

PHP version history (7 changes)0.1.0PHP ^7.1

0.3.0PHP ^7.3 || ~8.0.0

0.5.0PHP ^7.4 || ~8.0.0 || ~8.1.0

0.8.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0

1.0.0PHP ~8.1.0 || ~8.2.0

1.1.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

1.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25943?v=4)[Matthew Weier O'Phinney](/maintainers/weierophinney)[@weierophinney](https://github.com/weierophinney)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (182 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (72 commits)")[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (39 commits)")[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (18 commits)")[![arueckauer](https://avatars.githubusercontent.com/u/1815979?v=4)](https://github.com/arueckauer "arueckauer (17 commits)")[![boesing](https://avatars.githubusercontent.com/u/2189546?v=4)](https://github.com/boesing "boesing (10 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (9 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (6 commits)")[![Xerkus](https://avatars.githubusercontent.com/u/725842?v=4)](https://github.com/Xerkus "Xerkus (4 commits)")[![settermjd](https://avatars.githubusercontent.com/u/196801?v=4)](https://github.com/settermjd "settermjd (3 commits)")[![laminas-bot](https://avatars.githubusercontent.com/u/68250880?v=4)](https://github.com/laminas-bot "laminas-bot (3 commits)")[![PowerKiKi](https://avatars.githubusercontent.com/u/72603?v=4)](https://github.com/PowerKiKi "PowerKiKi (1 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (1 commits)")

---

Tags

hacktoberfesttestingcontainerPSR-11testlaminasmezzio

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laminas-laminas-container-config-test/health.svg)

```
[![Health](https://phpackages.com/badges/laminas-laminas-container-config-test/health.svg)](https://phpackages.com/packages/laminas-laminas-container-config-test)
```

###  Alternatives

[pestphp/pest

The elegant PHP Testing Framework.

11.6k72.2M20.5k](/packages/pestphp-pest)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k101.8M2.2k](/packages/behat-behat)[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.9k](/packages/orchestra-testbench)[testo/testo

A lightweight PHP testing framework.

1959.3k55](/packages/testo-testo)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M126](/packages/mezzio-mezzio)

PHPackages © 2026

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