From aef651a954533e6c8d09743531fed0daf778aad3 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 16 Nov 2018 07:07:33 +0100 Subject: [PATCH] Fix wrong capitalization of typeMap option --- .../DoctrineMongoDBExtension.php | 2 +- .../AbstractMongoDBExtensionTest.php | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DependencyInjection/DoctrineMongoDBExtension.php b/DependencyInjection/DoctrineMongoDBExtension.php index a1727e36..66b655ee 100644 --- a/DependencyInjection/DoctrineMongoDBExtension.php +++ b/DependencyInjection/DoctrineMongoDBExtension.php @@ -316,7 +316,7 @@ protected function loadConnections(array $connections, ContainerBuilder $contain private function normalizeDriverOptions(array $connection) { $driverOptions = $connection['driverOptions'] ?? []; - $driverOptions['typemap'] = ['root' => 'array', 'document' => 'array']; + $driverOptions['typeMap'] = ['root' => 'array', 'document' => 'array']; if (isset($driverOptions['context'])) { $driverOptions['context'] = new Reference($driverOptions['context']); diff --git a/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php b/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php index b1b5fccd..55ef362c 100644 --- a/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php +++ b/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php @@ -78,8 +78,8 @@ public function testDependencyInjectionConfigurationDefaults() $arguments = $definition->getArguments(); $this->assertEquals(null, $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.default_document_manager'); $this->assertEquals('%doctrine_mongodb.odm.document_manager.class%', $definition->getClass()); @@ -115,8 +115,8 @@ public function testSingleDocumentManagerConfiguration() $arguments = $definition->getArguments(); $this->assertEquals('mongodb://localhost:27017', $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.default_document_manager'); $this->assertEquals('%doctrine_mongodb.odm.document_manager.class%', $definition->getClass()); @@ -148,8 +148,8 @@ public function testLoadSimpleSingleConnection() $arguments = $definition->getArguments(); $this->assertEquals('mongodb://localhost:27017', $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.default_configuration'); $methodCalls = $definition->getMethodCalls(); @@ -192,8 +192,8 @@ public function testLoadSingleConnection() $arguments = $definition->getArguments(); $this->assertEquals('mongodb://localhost:27017', $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.default_document_manager'); $this->assertEquals('%doctrine_mongodb.odm.document_manager.class%', $definition->getClass()); @@ -228,8 +228,8 @@ public function testLoadMultipleConnections() $arguments = $definition->getArguments(); $this->assertEquals('mongodb://localhost:27017', $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.dm1_document_manager'); $this->assertEquals('%doctrine_mongodb.odm.document_manager.class%', $definition->getClass()); @@ -248,8 +248,8 @@ public function testLoadMultipleConnections() $arguments = $definition->getArguments(); $this->assertEquals('mongodb://localhost:27017', $arguments[0]); $this->assertEquals([], $arguments[1]); - $this->assertArrayHasKey('typemap', $arguments[2]); - $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typemap']); + $this->assertArrayHasKey('typeMap', $arguments[2]); + $this->assertSame(['root' => 'array', 'document' => 'array'], $arguments[2]['typeMap']); $definition = $container->getDefinition('doctrine_mongodb.odm.dm2_document_manager'); $this->assertEquals('%doctrine_mongodb.odm.document_manager.class%', $definition->getClass());