Skip to content

Commit 7dee116

Browse files
committed
Add DoctrineBundle in E2E tests if present
1 parent dd31106 commit 7dee116

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/End2End/App/Kernel.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Sentry\SentryBundle\Tests\End2End\App;
66

7+
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
78
use Symfony\Component\Config\Loader\LoaderInterface;
89
use Symfony\Component\DependencyInjection\ContainerBuilder;
910
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
@@ -17,11 +18,17 @@ class Kernel extends SymfonyKernel
1718
*/
1819
public function registerBundles(): array
1920
{
20-
return [
21+
$bundles = [
2122
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
2223
new \Symfony\Bundle\MonologBundle\MonologBundle(),
2324
new \Sentry\SentryBundle\SentryBundle(),
2425
];
26+
27+
if (class_exists(DoctrineBundle::class)) {
28+
$bundles[] = new DoctrineBundle();
29+
}
30+
31+
return $bundles;
2532
}
2633

2734
public function registerContainerConfiguration(LoaderInterface $loader): void
@@ -35,6 +42,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3542
if (interface_exists(MessageBusInterface::class) && self::VERSION_ID >= 40300) {
3643
$loader->load(__DIR__ . '/messenger.yml');
3744
}
45+
46+
if (class_exists(DoctrineBundle::class)) {
47+
$loader->load(__DIR__ . '/doctrine.yml');
48+
}
3849
}
3950

4051
protected function build(ContainerBuilder $container): void

tests/End2End/App/doctrine.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
doctrine:
2+
dbal:
3+
url: 'sqlite:///%kernel.project_dir%/var/data.db'

0 commit comments

Comments
 (0)