diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index c7ea00f..3c27c19 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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)) diff --git a/README.md b/README.md index 705a1a8..fc8a281 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index f7407ab..8dbd654 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -64,6 +64,7 @@ public function testSimpleConfiguration() 'do_flush' => false, 'schema_tool' => 'doctrine_schema_tool', + 'object_manager' => null, 'doctrine' => 'mongodb-odm', ) @@ -100,6 +101,7 @@ public function testMultiManagerConfiguration() 'do_flush' => false, 'schema_tool' => 'doctrine_schema_tool', + 'object_manager' => null, 'doctrine' => 'mongodb-odm', ) @@ -107,4 +109,22 @@ public function testMultiManagerConfiguration() ) ); } + + /** + * @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() + ); + } } \ No newline at end of file