Skip to content

Commit

Permalink
Bandaid for protobuf 4761 (#1176)
Browse files Browse the repository at this point in the history
* Temporary workaround for protobuf extension issue

protocolbuffers/protobuf#4761

* Bump gax to 0.36

* Configure comparators for the unit test

* Revert back to normal TestCase

* Install protobuf extension in the PHP 7.2 test runner

* Revert to TestCase
  • Loading branch information
Takashi Matsuo authored Jul 19, 2018
1 parent 72b8bf1 commit 84892bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"minimum-stability": "stable",
"require": {
"google/cloud-core": "^1.14",
"google/gax": "^0.35"
"google/gax": "^0.36"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
Expand Down
14 changes: 12 additions & 2 deletions tests/Unit/V1/ImageAnnotatorClientExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ public function testAnnotateImageWithImageContext()
$this->transport->startUnaryCall( Argument::allOf(
Argument::type(Call::class),
Argument::which('getMethod', 'google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages'),
Argument::which('getMessage', $expectedMessage)
Argument::that(function($arg) use ($expectedMessage) {
if ($arg->getMessage()->serializeToString() === $expectedMessage->serializeToString()) {
return true;
}
return false;
})
),
Argument::type('array')
)
Expand Down Expand Up @@ -160,7 +165,12 @@ public function testDetectionMethod($methodName, $featureType, $image)
Argument::allOf(
Argument::type(Call::class),
Argument::which('getMethod', 'google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages'),
Argument::which('getMessage', $expectedMessage)
Argument::that(function($arg) use ($expectedMessage) {
if ($arg->getMessage()->serializeToString() === $expectedMessage->serializeToString()) {
return true;
}
return false;
})
),
Argument::type('array')
)
Expand Down

0 comments on commit 84892bf

Please sign in to comment.