diff --git a/composer.json b/composer.json index b9d49a777..5b15af71a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "google/grpc-gcp": "^0.2||^0.3", "grpc/grpc": "^1.13", "google/protobuf": "^3.21.4", - "guzzlehttp/promises": "^1.3", + "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^2.0", "google/common-protos": "^3.0||^4.0", "google/longrunning": "^0.2" diff --git a/tests/Tests/Unit/Transport/GrpcFallbackTransportTest.php b/tests/Tests/Unit/Transport/GrpcFallbackTransportTest.php index ee166b681..94cf41e40 100644 --- a/tests/Tests/Unit/Transport/GrpcFallbackTransportTest.php +++ b/tests/Tests/Unit/Transport/GrpcFallbackTransportTest.php @@ -43,7 +43,7 @@ use Google\Rpc\Code; use Google\Rpc\Status; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; +use GuzzleHttp\Promise\Create; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use Psr\Http\Message\RequestInterface; @@ -94,7 +94,7 @@ public function testStartUnaryCall($apiEndpoint, $requestMessage) $httpHandler = function (RequestInterface $request, array $options = []) use ($expectedResponse, $expectedRequest) { $this->assertEquals($expectedRequest, $request); - return Promise\promise_for( + return Create::promiseFor( new Response( 200, [], @@ -130,7 +130,7 @@ public function startUnaryCallDataProvider() public function testStartUnaryCallThrowsException() { $httpHandler = function (RequestInterface $request, array $options = []) { - return Promise\rejection_for(new Exception()); + return Create::rejectionFor(new Exception()); }; $this->expectException(Exception::class); @@ -146,7 +146,7 @@ public function testStartUnaryCallThrowsRequestException() $status = new Status(); $status->setCode(Code::NOT_FOUND); $status->setMessage("Ruh-roh"); - return Promise\rejection_for( + return Create::rejectionFor( RequestException::create( new Request('POST', 'http://www.example.com'), new Response( @@ -219,7 +219,7 @@ public function buildInvalidData() public function testNonBinaryProtobufResponseException() { $httpHandler = function (RequestInterface $request, array $options = []) { - return Promise\rejection_for( + return Create::rejectionFor( RequestException::create( new Request('POST', 'http://www.example.com'), new Response(