Skip to content

Commit e608747

Browse files
authored
chore: add test for interfaceOverride (#421)
* chore: add test for interfaceOverride * back compat lamda * back compat strpos
1 parent 9dd5bc9 commit e608747

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/Tests/Unit/GapicClientTraitTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,19 @@ public function testStartApiCallUnary()
389389
->getMock();
390390
$unaryDescriptors = [
391391
'callType' => Call::UNARY_CALL,
392-
'responseType' => 'Google\Longrunning\Operation'
392+
'responseType' => 'Google\Longrunning\Operation',
393+
'interfaceOverride' => 'google.cloud.foo.v1.Foo'
393394
];
394395
$expectedPromise = new FulfilledPromise(new Operation());
395396
$transport = $this->getMockBuilder(TransportInterface::class)->getMock();
396397
$transport->expects($this->once())
397398
->method('startUnaryCall')
399+
->with(
400+
$this->callback(function($call) use ($unaryDescriptors) {
401+
return strpos($call->getMethod(), $unaryDescriptors['interfaceOverride']) !== false;
402+
}),
403+
$this->anything()
404+
)
398405
->will($this->returnValue($expectedPromise));
399406
$credentialsWrapper = CredentialsWrapper::build([]);
400407
$client = new GapicClientTraitStub();

0 commit comments

Comments
 (0)