diff --git a/tests/Unit/SDK/Common/Http/Psr/Message/UsesRequestFactoryTrait.php b/tests/Unit/SDK/Common/Http/Psr/Message/UsesRequestFactoryTrait.php index e816e6f6b..dcd49802f 100644 --- a/tests/Unit/SDK/Common/Http/Psr/Message/UsesRequestFactoryTrait.php +++ b/tests/Unit/SDK/Common/Http/Psr/Message/UsesRequestFactoryTrait.php @@ -4,6 +4,7 @@ namespace OpenTelemetry\Tests\Unit\SDK\Common\Http\Psr\Message; +use Nyholm\Psr7\Uri; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\RequestInterface; @@ -19,7 +20,7 @@ private function createRequestFactoryMock(?string $requestMethod = 'GET', ?strin $request->method('getMethod') ->willReturn((string) $requestMethod); $request->method('getUri') - ->willReturn((string) $requestUri); + ->willReturn(new Uri((string) $requestUri)); $factory = $this->createMock(RequestFactoryInterface::class); $factory->method('createRequest') ->willReturn($request); diff --git a/tests/Unit/SDK/Common/Http/Psr/Message/UsesServerRequestFactoryTrait.php b/tests/Unit/SDK/Common/Http/Psr/Message/UsesServerRequestFactoryTrait.php index 2b7007ad8..1e8db7725 100644 --- a/tests/Unit/SDK/Common/Http/Psr/Message/UsesServerRequestFactoryTrait.php +++ b/tests/Unit/SDK/Common/Http/Psr/Message/UsesServerRequestFactoryTrait.php @@ -4,6 +4,7 @@ namespace OpenTelemetry\Tests\Unit\SDK\Common\Http\Psr\Message; +use Nyholm\Psr7\Uri; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\ServerRequestInterface; @@ -19,7 +20,7 @@ private function createServerRequestFactoryMock(?string $requestMethod = 'GET', $request->method('getMethod') ->willReturn((string) $requestMethod); $request->method('getUri') - ->willReturn((string) $requestUri); + ->willReturn(new Uri((string) $requestUri)); $factory = $this->createMock(ServerRequestFactoryInterface::class); $factory->method('createServerRequest') ->willReturn($request);