Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Removed documentation skeleton and updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Feb 20, 2018
1 parent d782fa9 commit a72dd50
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 41 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/.travis.yml export-ignore
/composer.lock export-ignore
/docs/ export-ignore
/mkdocs.yml export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/clover.xml
/coveralls-upload.json
/docs/html/
/phpunit.xml
/vendor/
/zf-mkdoc-theme.tgz
/zf-mkdoc-theme/
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,43 @@
[![Build Status](https://secure.travis-ci.org/zendframework/zend-container-test.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-container-test)
[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-container-test/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-container-test?branch=master)

This library provides ...
This library provides common tests for PSR-11 containers configured
[`zend-servicemanager`](https://github.com/zendframework/zend-servicemanager)
[configuration](https://docs.zendframework.com/zend-servicemanager/configuring-the-service-manager/).

It guarantee us to deliver the same functionality across multiple PSR-11
container implementations and simplify switching between them.

Currently we support:
- `Aura.Di` - via [`zend-auradi-config`](https://github.com/zendframework/zend-auradi-config)
- `Pimple` - via [`zend-pimple-config`](https://github.com/zendframework/zend-pimple-config)
- [`zend-servicemanager`](https://github.com/zendframework/zend-servicemanager)

## Installation

Run the following to install this library:

```bash
$ composer require zendframework/zend-container-test
$ composer require --dev zendframework/zend-container-test
```

## Documentation
## Using common tests

Documentation is [in the doc tree](docs/book/), and can be compiled using [mkdocs](http://www.mkdocs.org):
In your library you have to extends `Zend\ContainerTest\ContainerTest` class
and implement method `createContainer`:

```bash
$ mkdocs build
```php
protected function createContainer(array $config) : ContainerInterface;
```

You may also [browse the documentation online](https://docs.zendframework.com/zend-container-test/).
It should return configured PSR-11 container.

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

- `Zend\ContainerTest\AliasTestTrait` - to support `aliases` configuration,
- `Zend\ContainerTest\FactoryTestTrait` - to support `factories` configuration,
- `Zend\ContainerTest\InvokableTestTrait` - to support `invokables` configuration,
- `Zend\ContainerTest\SharedTestTrait` - to support `shared` and `shared_by_default` configurations,

or use `Zend\ContainerTest\AllTestTrait` to support whole `zend-servicemanager` configuration.
9 changes: 0 additions & 9 deletions docs/book/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/book/index.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/book/intro.md

This file was deleted.

9 changes: 0 additions & 9 deletions mkdocs.yml

This file was deleted.

18 changes: 18 additions & 0 deletions src/AllTestTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* @see https://github.com/zendframework/zend-container-test for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-container-test/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);

namespace Zend\ContainerTest;

trait AllTestTrait
{
use AliasTestTrait;
use FactoryTestTrait;
use InvokableTestTrait;
use SharedTestTrait;
}
10 changes: 2 additions & 8 deletions test/BaseContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@

namespace ZendTest\ContainerTest;

use Zend\ContainerTest\AliasTestTrait;
use Zend\ContainerTest\AllTestTrait;
use Zend\ContainerTest\ContainerTest;
use Zend\ContainerTest\FactoryTestTrait;
use Zend\ContainerTest\InvokableTestTrait;
use Zend\ContainerTest\SharedTestTrait;

abstract class BaseContainerTest extends ContainerTest
{
use AliasTestTrait;
use FactoryTestTrait;
use InvokableTestTrait;
use SharedTestTrait;
use AllTestTrait;
}

0 comments on commit a72dd50

Please sign in to comment.