File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 16
16
</service >
17
17
18
18
<service id =" Sentry\State\HubInterface" class =" Sentry\State\Hub" public =" false" >
19
- <argument type =" service" id =" Sentry\ClientInterface" />
19
+ <factory class =" Sentry\SentryBundle\SentryBundle" method =" getCurrentHub" />
20
+ <call method =" bindClient" >
21
+ <argument type =" service" id =" Sentry\ClientInterface" />
22
+ </call >
20
23
</service >
21
24
22
25
<service id =" Sentry\SentryBundle\EventListener\ConsoleListener" class =" Sentry\SentryBundle\EventListener\ConsoleListener" public =" false" >
Original file line number Diff line number Diff line change 4
4
5
5
use Jean85 \PrettyVersions ;
6
6
use Monolog \Logger as MonologLogger ;
7
+ use Prophecy \Argument ;
7
8
use Sentry \Breadcrumb ;
8
9
use Sentry \ClientInterface ;
9
10
use Sentry \Event ;
12
13
use Sentry \Options ;
13
14
use Sentry \SentryBundle \DependencyInjection \SentryExtension ;
14
15
use Sentry \SentryBundle \EventListener \ErrorListener ;
16
+ use Sentry \SentryBundle \SentryBundle ;
15
17
use Sentry \SentryBundle \Test \BaseTestCase ;
16
18
use Sentry \Severity ;
19
+ use Sentry \State \HubInterface ;
17
20
use Sentry \State \Scope ;
18
21
use Symfony \Component \DependencyInjection \Alias ;
19
22
use Symfony \Component \DependencyInjection \Container ;
@@ -453,6 +456,10 @@ private function getContainer(array $configuration = []): Container
453
456
$ containerBuilder ->setAlias (self ::MONOLOG_HANDLER_TEST_PUBLIC_ALIAS , new Alias (Handler::class, true ));
454
457
}
455
458
459
+ $ hub = $ this ->prophesize (HubInterface::class);
460
+ $ hub ->bindClient (Argument::type (ClientMock::class));
461
+ SentryBundle::setCurrentHub ($ hub ->reveal ());
462
+
456
463
$ containerBuilder ->compile ();
457
464
458
465
return $ containerBuilder ;
Original file line number Diff line number Diff line change 13
13
use Sentry \SentryBundle \EventListener \ErrorListener ;
14
14
use Sentry \SentryBundle \EventListener \RequestListener ;
15
15
use Sentry \SentryBundle \EventListener \SubRequestListener ;
16
+ use Sentry \SentryBundle \SentryBundle ;
17
+ use Sentry \State \Hub ;
16
18
use Sentry \State \HubInterface ;
17
19
use Symfony \Component \Console \ConsoleEvents ;
18
20
use Symfony \Component \DependencyInjection \ContainerBuilder ;
@@ -158,6 +160,8 @@ private function getContainer(array $configuration = []): ContainerBuilder
158
160
$ extension = new SentryExtension ();
159
161
$ extension ->load (['sentry ' => $ configuration ], $ containerBuilder );
160
162
163
+ SentryBundle::setCurrentHub (new Hub ());
164
+
161
165
return $ containerBuilder ;
162
166
}
163
167
}
You can’t perform that action at this time.
0 commit comments