Skip to content

Commit a835577

Browse files
hjanuschkaJean85
authored andcommitted
Add Symfony version as default tag (#116)
1 parent ea4de13 commit a835577

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/SentrySymfonyClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function __construct(?string $dsn = null, array $options = [])
1515
'name' => 'sentry-symfony',
1616
'version' => SentryBundle::getVersion(),
1717
];
18+
$options['tags']['symfony_version'] = \Symfony\Component\HttpKernel\Kernel::VERSION;
1819

1920
parent::__construct($dsn, $options);
2021
}

test/SentrySymfonyClientTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ public function test_that_it_forwards_options()
2222
{
2323
$client = new SentrySymfonyClient('https://a:[email protected]/project', [
2424
'name' => 'test',
25+
'tags' => ['some_custom' => 'test'],
2526
]);
2627

2728
$data = $client->get_default_data();
2829

2930
// Not a big fan of doing this kind of assertions, couples tests to external API...
3031
// Perhaps, refactor is needed for this class?
3132
$this->assertEquals('test', $data['server_name']);
33+
$this->assertEquals(\Symfony\Component\HttpKernel\Kernel::VERSION, $data['tags']['symfony_version']);
34+
$this->assertEquals('test', $data['tags']['some_custom']);
3235
$this->assertEquals('https://app.getsentry.com/api/project/store/', $client->getServerEndpoint(null));
3336
$this->assertEquals('a', $client->public_key);
3437
$this->assertEquals('b', $client->secret_key);

0 commit comments

Comments
 (0)