Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fa06a50

Browse files
committedApr 8, 2024··
Fix tests
1 parent 73829ee commit fa06a50

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed
 

‎tests/Tracing/HttpClient/TraceableHttpClientTest.php

+4-7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class TraceableHttpClientTest extends TestCase
4646

4747
public static function setUpBeforeClass(): void
4848
{
49-
if (!self::isHttpClientPackageInstalled()) {
49+
if (!interface_exists(HttpClientInterface::class)) {
5050
self::markTestSkipped('This test requires the "symfony/http-client" Composer package to be installed.');
5151
}
5252
}
@@ -357,13 +357,10 @@ public function testWithOptions(): void
357357
$this->assertSame('GET', $response->getInfo('http_method'));
358358
$this->assertSame('https://www.example.org/test-page', $response->getInfo('url'));
359359
}
360+
}
360361

361-
private static function isHttpClientPackageInstalled(): bool
362+
if (interface_exists(HttpClientInterface::class)) {
363+
interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface
362364
{
363-
return interface_exists(HttpClientInterface::class);
364365
}
365366
}
366-
367-
interface TestableHttpClientInterface extends HttpClientInterface, LoggerAwareInterface, ResetInterface
368-
{
369-
}

‎tests/Tracing/HttpClient/TraceableResponseTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ final class TraceableResponseTest extends TestCase
2828
*/
2929
private $hub;
3030

31+
public static function setUpBeforeClass(): void
32+
{
33+
if (!interface_exists(HttpClientInterface::class)) {
34+
self::markTestSkipped('This test requires the "symfony/http-client" Composer package to be installed.');
35+
}
36+
}
37+
3138
protected function setUp(): void
3239
{
3340
$this->client = $this->createMock(HttpClientInterface::class);

0 commit comments

Comments
 (0)
Please sign in to comment.