@@ -263,6 +263,21 @@ public function testIgnoreErrorsIntegrationIsNotAddedTwiceIfAlreadyConfigured():
263
263
$ this ->assertSame (1 , $ ignoreErrorsIntegrationsCount );
264
264
}
265
265
266
+ public function testEmptyDsnIsPropagatedToOptions (): void
267
+ {
268
+ $ this ->assertDsnPropagation ('dsn_empty_string ' , '' );
269
+ }
270
+
271
+ public function testFalseDsnIsPropagatedToOptions (): void
272
+ {
273
+ $ this ->assertDsnPropagation ('dsn_false ' , false );
274
+ }
275
+
276
+ public function testNullDsnIsPropagatedToOptions (): void
277
+ {
278
+ $ this ->assertDsnPropagation ('dsn_null ' , null );
279
+ }
280
+
266
281
private function createContainerFromFixture (string $ fixtureFile ): ContainerBuilder
267
282
{
268
283
$ container = new ContainerBuilder (new EnvPlaceholderParameterBag ([
@@ -292,4 +307,17 @@ private function assertDefinitionMethodCallAt(array $methodCall, string $method,
292
307
$ this ->assertSame ($ method , $ methodCall [0 ]);
293
308
$ this ->assertEquals ($ arguments , $ methodCall [1 ]);
294
309
}
310
+
311
+ /**
312
+ * @param mixed $result
313
+ */
314
+ private function assertDsnPropagation (string $ fixtureFile , $ result ): void
315
+ {
316
+ $ container = $ this ->createContainerFromFixture ($ fixtureFile );
317
+ $ optionsDefinition = $ container ->getDefinition ('sentry.client.options ' );
318
+
319
+ $ this ->assertSame (Options::class, $ optionsDefinition ->getClass ());
320
+ $ this ->assertTrue (\array_key_exists ('dsn ' , $ optionsDefinition ->getArgument (0 )));
321
+ $ this ->assertSame ($ result , $ optionsDefinition ->getArgument (0 )['dsn ' ]);
322
+ }
295
323
}
0 commit comments