From 8dc020077f0edb150aa4cf0ac49f78fcbba4d5b4 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Mon, 12 Mar 2018 15:22:38 +0100 Subject: [PATCH] symfony version in 0.8.x (backport of #116) (cherry picked from commit d68d99e) --- src/Sentry/SentryBundle/SentrySymfonyClient.php | 2 ++ test/SentrySymfonyClientTest.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Sentry/SentryBundle/SentrySymfonyClient.php b/src/Sentry/SentryBundle/SentrySymfonyClient.php index 062948e4..c342068f 100644 --- a/src/Sentry/SentryBundle/SentrySymfonyClient.php +++ b/src/Sentry/SentryBundle/SentrySymfonyClient.php @@ -15,6 +15,8 @@ public function __construct($dsn=null, $options=array(), $error_types='') 'name' => 'sentry-symfony', 'version' => SentryBundle::VERSION, ); + $options['tags']['symfony_version'] = \Symfony\Component\HttpKernel\Kernel::VERSION; + parent::__construct($dsn, $options); } } diff --git a/test/SentrySymfonyClientTest.php b/test/SentrySymfonyClientTest.php index 2df63bb6..c72474e5 100644 --- a/test/SentrySymfonyClientTest.php +++ b/test/SentrySymfonyClientTest.php @@ -20,7 +20,8 @@ public function test_that_it_sets_sdk_name_and_version() public function test_that_it_forwards_options() { $client = new SentrySymfonyClient('https://a:b@app.getsentry.com/project', array( - 'name' => 'test' + 'name' => 'test', + 'tags' => array('some_custom' => 'test'), )); $data = $client->get_default_data(); @@ -28,6 +29,8 @@ public function test_that_it_forwards_options() // Not a big fan of doing this kind of assertions, couples tests to external API... // Perhaps, refactor is needed for this class? $this->assertEquals('test', $data['server_name']); + $this->assertEquals(\Symfony\Component\HttpKernel\Kernel::VERSION, $data['tags']['symfony_version']); + $this->assertEquals('test', $data['tags']['some_custom']); $this->assertEquals('https://app.getsentry.com/api/project/store/', $client->getServerEndpoint(null)); $this->assertEquals('a', $client->public_key); $this->assertEquals('b', $client->secret_key);