Skip to content

Commit 0eaaee7

Browse files
authored
Merge pull request #408 from baleyko/bundlefree-kernel-support
Add kernel root directory to fixtures location paths
2 parents 8345a80 + 51fbe91 commit 0eaaee7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Command/LoadDataFixturesDoctrineODMCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787
$paths = is_array($dirOrFile) ? $dirOrFile : [$dirOrFile];
8888
} elseif ($bundles) {
8989
$kernel = $this->getContainer()->get('kernel');
90+
$paths = [$kernel->getRootDir().'/DataFixtures/MongoDB'];
9091
foreach ($bundles as $bundle) {
9192
$paths[] = $kernel->getBundle($bundle)->getPath();
9293
}
9394
} else {
95+
$kernel = $this->getContainer()->get('kernel');
9496
$paths = $this->getContainer()->getParameter('doctrine_mongodb.odm.fixtures_dirs');
9597
$paths = is_array($paths) ? $paths : [$paths];
96-
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
98+
$paths[] = $kernel->getRootDir().'/DataFixtures/MongoDB';
99+
foreach ($kernel->getBundles() as $bundle) {
97100
$paths[] = $bundle->getPath().'/DataFixtures/MongoDB';
98101
}
99102
}

0 commit comments

Comments
 (0)