Skip to content

Commit 1398d0c

Browse files
committed
Register command
1 parent a6fecad commit 1398d0c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Resources/config/services.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@
4949
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="%sentry.listener_priorities.sub_request%" />
5050
<tag name="kernel.event_listener" event="kernel.finish_request" method="onKernelFinishRequest" priority="%sentry.listener_priorities.sub_request%" />
5151
</service>
52+
53+
<service id="Sentry\SentryBundle\Command\SentryTestCommand" class="Sentry\SentryBundle\Command\SentryTestCommand" public="false">
54+
<tag name="console.command" />
55+
</service>
5256
</services>
5357
</container>

test/SentryBundleTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sentry\Integration\ExceptionListenerIntegration;
88
use Sentry\Integration\IntegrationInterface;
99
use Sentry\Integration\RequestIntegration;
10+
use Sentry\SentryBundle\Command\SentryTestCommand;
1011
use Sentry\SentryBundle\DependencyInjection\SentryExtension;
1112
use Sentry\SentryBundle\EventListener\ConsoleListener;
1213
use Sentry\SentryBundle\EventListener\ErrorListener;
@@ -121,6 +122,15 @@ public function testContainerHasErrorListenerConfiguredCorrectly(): void
121122
$this->assertSame($expectedTag, $consoleListener->getTags());
122123
}
123124

125+
public function testContainerHasTestCommandRegisteredCorrectly(): void
126+
{
127+
$container = $this->getContainer();
128+
129+
$consoleListener = $container->getDefinition(SentryTestCommand::class);
130+
131+
$this->assertArrayHasKey('console.command', $consoleListener->getTags());
132+
}
133+
124134
public function testIntegrationsListenersAreDisabledByDefault(): void
125135
{
126136
$container = $this->getContainer();

0 commit comments

Comments
 (0)