From 1b0d5a25bfecbec0e5180067442189cc61b40e44 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Mon, 12 Mar 2018 13:37:59 +0100 Subject: [PATCH 1/2] backport https://github.com/getsentry/sentry-symfony/pull/116 to 1.x --- src/SentrySymfonyClient.php | 1 + test/SentrySymfonyClientTest.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/SentrySymfonyClient.php b/src/SentrySymfonyClient.php index 723d6c37..01b6f351 100644 --- a/src/SentrySymfonyClient.php +++ b/src/SentrySymfonyClient.php @@ -15,6 +15,7 @@ public function __construct($dsn = null, $options = []) '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 8f82fa80..c7be4e01 100644 --- a/test/SentrySymfonyClientTest.php +++ b/test/SentrySymfonyClientTest.php @@ -22,6 +22,7 @@ public function test_that_it_forwards_options() { $client = new SentrySymfonyClient('https://a:b@app.getsentry.com/project', [ 'name' => 'test', + 'tags' => ['some_custom' => 'test'], ]); $data = $client->get_default_data(); @@ -29,6 +30,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); From 57d3919e97c36264407e4b0c66ddce3a87a096f4 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Mon, 12 Mar 2018 13:42:42 +0100 Subject: [PATCH 2/2] cs fix --- test/SentrySymfonyClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/SentrySymfonyClientTest.php b/test/SentrySymfonyClientTest.php index c7be4e01..c103ff57 100644 --- a/test/SentrySymfonyClientTest.php +++ b/test/SentrySymfonyClientTest.php @@ -31,7 +31,7 @@ public function test_that_it_forwards_options() // 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('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);