Skip to content

Commit 4b5ea8a

Browse files
committed
Make the tracing test work without Doctrine too
1 parent 3cd3317 commit 4b5ea8a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tests/End2End/App/Controller/TracingController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@
1010
class TracingController
1111
{
1212
/**
13-
* @var Connection
13+
* @var Connection|null
1414
*/
1515
private $connection;
1616

17-
public function __construct(Connection $connection)
17+
public function __construct(Connection $connection = null)
1818
{
1919
$this->connection = $connection;
2020
}
2121

2222
public function pingDatabase(): Response
2323
{
24-
$this->connection->executeQuery('SELECT 1');
24+
if ($this->connection) {
25+
$this->connection->executeQuery('SELECT 1');
26+
}
2527

2628
return new Response('Success');
2729
}

tests/End2End/App/tracing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ sentry:
77
services:
88
Sentry\SentryBundle\Tests\End2End\App\Controller\TracingController:
99
arguments:
10-
- '@doctrine.dbal.default_connection'
10+
- '@?doctrine.dbal.default_connection'
1111
tags:
1212
- controller.service_arguments

0 commit comments

Comments
 (0)