2017 © Pedro Peláez
 

library zend-container-config-test

Expressive PSR-11 container configuration tests

image

zendframework/zend-container-config-test

Expressive PSR-11 container configuration tests

  • Friday, April 13, 2018
  • by zendframework
  • Repository
  • 12 Watchers
  • 1 Stars
  • 608 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 73 % Grown

The README.md

zend-container-config-test

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-container-config-test., (*1)

Build Status Coverage Status, (*2)

This library provides common tests for PSR-11 containers configured using a subset of zend-servicemanager configuration as specified by Expressive, (*3)

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

Currently we support: - Aura.Di - via zend-auradi-config - Pimple - via zend-pimple-config - zend-servicemanager, (*5)

Installation

Run the following to install this library:, (*6)

$ composer require --dev zendframework/zend-container-config-test

Using common tests

In your library, you will need to extend the Zend\ContainerConfigTest\AbstractContainerTest class within your test suite and implement the method createContainer:, (*7)

protected function createContainer(array $config) : ContainerInterface;

It should return your PSR-11-compatible container, configured using $config., (*8)

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

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

To provide an Expressive-compatible container, you should extend the class Zend\ContainerConfigTest\AbstractExpressiveContainerConfigTest and implement the method createContainer. This class composes the following traits:, (*10)

  • Zend\ContainerConfigTest\AliasTestTrait,
  • Zend\ContainerConfigTest\DelegatorTestTrait,
  • Zend\ContainerConfigTest\FactoryTestTrait,
  • Zend\ContainerConfigTest\InvokableTestTrait,
  • Zend\ContainerConfigTest\ServiceTestTrait.

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

use Zend\ContainerConfigTest\AbstractExpressiveContainerConfigTest;
use Zend\ContainerConfigTest\SharedTestTrait;

class ContainerTest extends AbstractExpressiveContainerConfigTest
{
    use SharedTestTrait;

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

The Versions

13/04 2018

dev-master

9999999-dev

Expressive PSR-11 container configuration tests

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

test container zendframework zf expressive psr-11

12/04 2018

0.2.1

0.2.1.0

Expressive PSR-11 container configuration tests

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

test container zendframework zf expressive psr-11

11/04 2018

0.2.0

0.2.0.0

Expressive PSR-11 container configuration tests

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

test container zendframework zf expressive psr-11

10/04 2018

0.1.0

0.1.0.0

Expressive PSR-11 container configuration tests

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

test container zendframework zf expressive psr-11