Skip to content

Commit

Permalink
symfony version in 1.x (#117, backport of #116)
Browse files Browse the repository at this point in the history
* backport #116 to 1.x
* cs fix
  • Loading branch information
hjanuschka authored and Jean85 committed Mar 12, 2018
1 parent 76bc046 commit d68d99e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SentrySymfonyClient.php
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions test/SentrySymfonyClientTest.php
Expand Up @@ -22,13 +22,16 @@ 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();

// 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 d68d99e

Please sign in to comment.