<commit_before># SymfonyDependencyInjectionTest

By <NAME>

[![Build Status](https://secure.travis-ci.org/matthiasnoback/SymfonyDependencyInjectionTest.png)](http://travis-ci.org/matthiasnoback/SymfonyDependencyInjectionTest)

This library contains several PHPUnit test case classes and many semantic [assertions](#list-of-assertions) which
you can use to functionally test your [container extensions](#testing-a-container-extension) (or "bundle extensions")
and [compiler passes](#testing-a-compiler-pass). It also provides the tools to functionally test your container
extension (or "bundle") configuration by verifying processed values from different types of configuration files.

Besides verifying their correctness, this library will also help you to adopt a TDD approach when developing
these classes.

## Installation

Using Composer:

    php composer.phar require matthiasnoback/symfony-dependency-injection-test 0.*

## Usage

### Testing a container extension

To test your own container extension class ``MyExtension`` create a class and extend from
``Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase``. Then implement the
``getContainerExtensions()`` method:

```php
<?php

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;

class MyExtensionTest extends AbstractExtensionTestCase
{
    protected function getContainerExtensions()<commit_msg>Add as dev dependency<commit_after># SymfonyDependencyInjectionTest

By <NAME>

[![Build Status](https://secure.travis-ci.org/matthiasnoback/SymfonyDependencyInjectionTest.png)](http://travis-ci.org/matthiasnoback/SymfonyDependencyInjectionTest)

This library contains several PHPUnit test case classes and many semantic [assertions](#list-of-assertions) which
you can use to functionally test your [container extensions](#testing-a-container-extension) (or "bundle extensions")
and [compiler passes](#testing-a-compiler-pass). It also provides the tools to functionally test your container
extension (or "bundle") configuration by verifying processed values from different types of configuration files.

Besides verifying their correctness, this library will also help you to adopt a TDD approach when developing
these classes.

## Installation

Using Composer:

    php composer.phar require --dev matthiasnoback/symfony-dependency-injection-test 0.*

## Usage

### Testing a container extension

To test your own container extension class ``MyExtension`` create a class and extend from
``Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase``. Then implement the
``getContainerExtensions()`` method:

```php
<?php

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;

class MyExtensionTest extends AbstractExtensionTestCase
{
    protected function getContainerExtensions()
{'fraction_non_alphanumeric': 0.07974594213126324, 'fraction_numerical': 0.0007057163020465773, 'mean_word_length': 6.600536193029491, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5337431', 'n_tokens_mistral': 736, 'n_tokens_neox': 697, 'n_words': 245}