Skip to content

Commit

Permalink
symfony version in 0.8.x (backport of #116)
Browse files Browse the repository at this point in the history
(cherry picked from commit d68d99e)
  • Loading branch information
hjanuschka authored and Jean85 committed Jun 1, 2018
1 parent 65bbda9 commit 8dc0200
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Sentry/SentryBundle/SentrySymfonyClient.php
Expand Up @@ -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);
}
}
5 changes: 4 additions & 1 deletion test/SentrySymfonyClientTest.php
Expand Up @@ -20,14 +20,17 @@ 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();

// 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);
Expand Down

0 comments on commit 8dc0200

Please sign in to comment.