Skip to content

Commit

Permalink
fix withOptions test for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Jul 5, 2022
1 parent fd9f433 commit 39eaa7f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Tracing/HttpClient/TraceableHttpClientForV4.php
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Sentry\SentryBundle\Tracing\HttpClient;

final class TraceableHttpClientForV4 extends AbstractTraceableHttpClient
{
}
3 changes: 2 additions & 1 deletion src/aliases.php
Expand Up @@ -18,6 +18,7 @@
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingStatementForV2;
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingStatementForV3;
use Sentry\SentryBundle\Tracing\HttpClient\TraceableHttpClient;
use Sentry\SentryBundle\Tracing\HttpClient\TraceableHttpClientForV4;
use Sentry\SentryBundle\Tracing\HttpClient\TraceableHttpClientForV5;
use Sentry\SentryBundle\Tracing\HttpClient\TraceableHttpClientForV6;
use Sentry\SentryBundle\Tracing\HttpClient\TraceableResponse;
Expand Down Expand Up @@ -62,7 +63,7 @@ class_alias(TracingDriverForV2::class, TracingDriver::class);
if (!class_exists(TraceableResponse::class) && interface_exists(ResponseInterface::class)) {
if (!interface_exists(StreamableInterface::class)) {
class_alias(TraceableResponseForV4::class, TraceableResponse::class);
class_alias(TraceableHttpClientForV5::class, TraceableHttpClient::class);
class_alias(TraceableHttpClientForV4::class, TraceableHttpClient::class);
} elseif (version_compare(\PHP_VERSION, '8.0', '>=')) {
class_alias(TraceableResponseForV6::class, TraceableResponse::class);
class_alias(TraceableHttpClientForV6::class, TraceableHttpClient::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/DependencyInjection/Fixtures/php/full.php
Expand Up @@ -51,6 +51,9 @@
'enabled' => false,
'connections' => ['default'],
],
'http_client' => [
'enabled' => false,
],
'twig' => [
'enabled' => false,
],
Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/Fixtures/xml/full.xml
Expand Up @@ -49,6 +49,7 @@
</sentry:dbal>
<sentry:twig enabled="false" />
<sentry:cache enabled="false" />
<sentry:http-client enabled="false" />
<sentry:console>
<sentry:excluded-command>app:command</sentry:excluded-command>
</sentry:console>
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/Fixtures/yml/full.yml
Expand Up @@ -50,6 +50,8 @@ sentry:
enabled: false
cache:
enabled: false
http_client:
enabled: false
console:
excluded_commands:
- app:command
4 changes: 4 additions & 0 deletions tests/Tracing/HttpClient/TraceableHttpClientTest.php
Expand Up @@ -118,6 +118,10 @@ public function testResetCallShouldBeForwardedToDecoratedInstance(): void

public function testWithOptions(): void
{
if (!method_exists(MockHttpClient::class, 'withOptions')) {
self::markTestSkipped();
}

$transaction = new Transaction(new TransactionContext());
$transaction->initSpanRecorder();

Expand Down

0 comments on commit 39eaa7f

Please sign in to comment.