33namespace BabDev \MoneyBundle \Tests \DependencyInjection ;
44
55use BabDev \MoneyBundle \BabDevMoneyBundle ;
6+ use JMS \SerializerBundle \JMSSerializerBundle ;
67use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionTestCase ;
78use Symfony \Component \DependencyInjection \Extension \ExtensionInterface ;
89
@@ -13,6 +14,13 @@ public function testContainerIsLoadedWithDefaultConfiguration(): void
1314 $ this ->container ->setParameter ('kernel.environment ' , 'dev ' );
1415 $ this ->container ->setParameter ('kernel.build_dir ' , __DIR__ );
1516
17+ $ this ->container ->setParameter (
18+ 'kernel.bundles ' ,
19+ [
20+ 'BabDevMoneyBundle ' => BabDevMoneyBundle::class,
21+ ],
22+ );
23+
1624 $ this ->load ();
1725
1826 $ this ->assertContainerBuilderHasParameter ('babdev_money.default_currency ' , 'USD ' );
@@ -27,6 +35,13 @@ public function testContainerIsLoadedWithCustomConfiguration(): void
2735 $ this ->container ->setParameter ('kernel.environment ' , 'dev ' );
2836 $ this ->container ->setParameter ('kernel.build_dir ' , __DIR__ );
2937
38+ $ this ->container ->setParameter (
39+ 'kernel.bundles ' ,
40+ [
41+ 'BabDevMoneyBundle ' => BabDevMoneyBundle::class,
42+ ],
43+ );
44+
3045 $ this ->load (['default_currency ' => 'EUR ' ]);
3146
3247 $ this ->assertContainerBuilderHasParameter ('babdev_money.default_currency ' , 'EUR ' );
@@ -38,6 +53,18 @@ public function testContainerIsLoadedWithCustomConfiguration(): void
3853
3954 public function testContainerIsLoadedWhenJMSSerializerBundleIsInstalled (): void
4055 {
56+ if (!class_exists (JMSSerializerBundle::class)) {
57+ self ::markTestSkipped ('Test requires JMSSerializerBundle ' );
58+ }
59+
60+ $ this ->container ->setParameter (
61+ 'kernel.bundles ' ,
62+ [
63+ 'BabDevMoneyBundle ' => BabDevMoneyBundle::class,
64+ 'JMSSerializerBundle ' => JMSSerializerBundle::class,
65+ ],
66+ );
67+
4168 $ this ->container ->setParameter ('kernel.environment ' , 'dev ' );
4269 $ this ->container ->setParameter ('kernel.build_dir ' , __DIR__ );
4370
@@ -56,6 +83,13 @@ public function testContainerIsLoadedWhenTwigBundleIsInstalled(): void
5683 $ this ->container ->setParameter ('kernel.environment ' , 'dev ' );
5784 $ this ->container ->setParameter ('kernel.build_dir ' , __DIR__ );
5885
86+ $ this ->container ->setParameter (
87+ 'kernel.bundles ' ,
88+ [
89+ 'BabDevMoneyBundle ' => BabDevMoneyBundle::class,
90+ ],
91+ );
92+
5993 $ this ->load ();
6094
6195 $ this ->assertContainerBuilderHasParameter ('babdev_money.default_currency ' , 'USD ' );
0 commit comments