zendframework/zend-container-config-test

Name: zend-container-config-test

Owner: Zend Framework

Description: Expressive PSR-11 Container configuration tests

Created: 2018-02-09 11:22:15.0

Updated: 2018-04-13 11:51:59.0

Pushed: 2018-04-13 11:51:58.0

Homepage:

Size: 156

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

zend-container-config-test

Build Status Coverage Status

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

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

Currently we support:

Installation

Run the following to install this library:

mposer 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:

ected 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:

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:

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

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

s ContainerTest extends AbstractExpressiveContainerConfigTest

use SharedTestTrait;

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.