Skip to content

Commit

Permalink
Merge pull request #27 from h4cc/feature/config-warning
Browse files Browse the repository at this point in the history
Feature: Config warning
  • Loading branch information
h4cc committed Sep 8, 2014
2 parents 9c8af4c + 797f289 commit 147f5f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ private function getManagersNode()
->defaultValue(null)
->info('Define service id for the used Schema tool.')
->end()
->scalarNode('object_manager')
->defaultValue(null)
->info('[DEPRECATED] Define service id for the used ObjectManager.')
->validate()
->always()->thenInvalid('Using a deprecated configuration value: "object_manager". Remove it from your configuration.')
->end()
->end()
->enumNode('doctrine')
->defaultValue(static::DOCTRINE_ORM)
->values(array(static::DOCTRINE_ORM, static::DOCTRINE_MONGODB_ODM))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AliceFixturesBundle

A Symfony2 bundle for flexible usage of [nelmio/alice](https://github.com/nelmio/alice) and [fzaninotto/Faker](https://github.com/fzaninotto/Faker) in Symfony2.

[![Build Status](https://travis-ci.org/h4cc/AliceFixturesBundle.png?branch=master)](https://travis-ci.org/h4cc/AliceFixturesBundle)
[![Build Status](https://travis-ci.org/h4cc/AliceFixturesBundle.svg?branch=master)](https://travis-ci.org/h4cc/AliceFixturesBundle)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/h4cc/AliceFixturesBundle/badges/quality-score.png?s=2f90c394022338ad406685a575f6ac7ebcde2a2e)](https://scrutinizer-ci.com/g/h4cc/AliceFixturesBundle/)
[![Code Coverage](https://scrutinizer-ci.com/g/h4cc/AliceFixturesBundle/badges/coverage.png?s=9bf0abf8ef0ecf41d6187cb8cebca02520fb7150)](https://scrutinizer-ci.com/g/h4cc/AliceFixturesBundle/)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/bcd3cd50-845f-41d3-afbd-93e0a39f03c7/mini.png)](https://insight.sensiolabs.com/projects/bcd3cd50-845f-41d3-afbd-93e0a39f03c7)
Expand Down
20 changes: 20 additions & 0 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function testSimpleConfiguration()
'do_flush' => false,

'schema_tool' => 'doctrine_schema_tool',
'object_manager' => null,

'doctrine' => 'mongodb-odm',
)
Expand Down Expand Up @@ -100,11 +101,30 @@ public function testMultiManagerConfiguration()
'do_flush' => false,

'schema_tool' => 'doctrine_schema_tool',
'object_manager' => null,

'doctrine' => 'mongodb-odm',
)
),
)
);
}

/**
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage Invalid configuration for path "h4cc_alice_fixtures.managers.my_manager.object_manager": Using a deprecated configuration value: "object_manager". Remove it from your configuration.
*/
public function testDeprecatedObjectManager()
{
$this->assertProcessedConfigurationEquals(
array(array(
'managers' => array(
'my_manager' => array(
'object_manager' => 'doctrine.manager',
)
)
)),
array()
);
}
}

0 comments on commit 147f5f1

Please sign in to comment.