22
22
use Sentry \Tracing \TraceId ;
23
23
use Sentry \Tracing \Transaction ;
24
24
use Sentry \Tracing \TransactionContext ;
25
+ use Symfony \Component \HttpClient \HttpClient ;
25
26
use Symfony \Component \HttpClient \MockHttpClient ;
26
27
use Symfony \Component \HttpClient \Response \MockResponse ;
27
28
use Symfony \Contracts \HttpClient \HttpClientInterface ;
@@ -46,7 +47,7 @@ final class TraceableHttpClientTest extends TestCase
46
47
47
48
public static function setUpBeforeClass (): void
48
49
{
49
- if (!self :: isHttpClientPackageInstalled ( )) {
50
+ if (!class_exists (HttpClient::class )) {
50
51
self ::markTestSkipped ('This test requires the "symfony/http-client" Composer package to be installed. ' );
51
52
}
52
53
}
@@ -357,13 +358,10 @@ public function testWithOptions(): void
357
358
$ this ->assertSame ('GET ' , $ response ->getInfo ('http_method ' ));
358
359
$ this ->assertSame ('https://www.example.org/test-page ' , $ response ->getInfo ('url ' ));
359
360
}
361
+ }
360
362
361
- private static function isHttpClientPackageInstalled (): bool
363
+ if (interface_exists (HttpClientInterface::class)) {
364
+ interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface
362
365
{
363
- return interface_exists (HttpClientInterface::class);
364
366
}
365
367
}
366
-
367
- interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface
368
- {
369
- }
0 commit comments