diff --git a/tests/Tracing/HttpClient/TraceableHttpClientTest.php b/tests/Tracing/HttpClient/TraceableHttpClientTest.php index 7b8f69d1..d9abbd24 100644 --- a/tests/Tracing/HttpClient/TraceableHttpClientTest.php +++ b/tests/Tracing/HttpClient/TraceableHttpClientTest.php @@ -46,7 +46,7 @@ final class TraceableHttpClientTest extends TestCase public static function setUpBeforeClass(): void { - if (!self::isHttpClientPackageInstalled()) { + if (!interface_exists(HttpClientInterface::class)) { self::markTestSkipped('This test requires the "symfony/http-client" Composer package to be installed.'); } } @@ -357,13 +357,10 @@ public function testWithOptions(): void $this->assertSame('GET', $response->getInfo('http_method')); $this->assertSame('https://www.example.org/test-page', $response->getInfo('url')); } +} - private static function isHttpClientPackageInstalled(): bool +if (interface_exists(HttpClientInterface::class)) { + interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface { - return interface_exists(HttpClientInterface::class); } } - -interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface -{ -} diff --git a/tests/Tracing/HttpClient/TraceableResponseTest.php b/tests/Tracing/HttpClient/TraceableResponseTest.php index e67616d5..96668458 100644 --- a/tests/Tracing/HttpClient/TraceableResponseTest.php +++ b/tests/Tracing/HttpClient/TraceableResponseTest.php @@ -28,6 +28,13 @@ final class TraceableResponseTest extends TestCase */ private $hub; + public static function setUpBeforeClass(): void + { + if (!interface_exists(HttpClientInterface::class)) { + self::markTestSkipped('This test requires the "symfony/http-client" Composer package to be installed.'); + } + } + protected function setUp(): void { $this->client = $this->createMock(HttpClientInterface::class);