Skip to content

Commit

Permalink
chore: support guzzle/promises:v2 (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Jun 9, 2023
1 parent 7a867a5 commit 753eae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions tests/Tests/Unit/Transport/GrpcFallbackTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
[],
Expand Down Expand Up @@ -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);
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 753eae9

Please sign in to comment.