Skip to content

Commit 08bb437

Browse files
authored
Merge pull request #2862 from dunglas/improve-mongodb-config
Improve MongoDB Bundle detection
2 parents 020bbc7 + 3557fd8 commit 08bb437

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
composer remove --dev --no-progress --no-update --ansi \
4545
doctrine/mongodb-odm \
4646
doctrine/mongodb-odm-bundle \
47-
- sed -i '33,39d' tests/Fixtures/app/config/config_common.yml
4847
- *update-project-dependencies
4948
before_script:
5049
- *clear-test-app-cache

tests/Fixtures/app/AppKernel.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
137137

138138
$c->loadFromExtension('security', $securityConfig);
139139

140+
if (class_exists(DoctrineMongoDBBundle::class)) {
141+
$c->loadFromExtension('doctrine_mongodb', [
142+
'connections' => [
143+
'default' => null,
144+
],
145+
'document_managers' => [
146+
'default' => [
147+
'auto_mapping' => true,
148+
],
149+
],
150+
]);
151+
}
152+
140153
if ($_SERVER['LEGACY'] ?? true) {
141154
$c->loadFromExtension('nelmio_api_doc', [
142155
'sandbox' => [

tests/Fixtures/app/config/config_common.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ doctrine:
3030
auto_generate_proxy_classes: '%kernel.debug%'
3131
auto_mapping: true
3232

33-
doctrine_mongodb:
34-
connections:
35-
default: ~
36-
document_managers:
37-
default:
38-
auto_mapping: true
39-
4033
twig:
4134
strict_variables: '%kernel.debug%'
4235

0 commit comments

Comments
 (0)