aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/tests
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2015-12-11 11:09:57 -0800
committerGravatar Stanley Cheung <stanleycheung@google.com>2015-12-11 11:09:57 -0800
commitd1cf36cdb70819443d5d22a11e3058aae7f7ce63 (patch)
treeaf49224e4d0d689269be6276835402659d8129f4 /src/php/tests
parentb5f74f1b18a6ec20b04fb2c565cc79390f4732ff (diff)
pass auth metadata context to user callback
Diffstat (limited to 'src/php/tests')
-rwxr-xr-xsrc/php/tests/interop/interop_client.php4
-rw-r--r--src/php/tests/unit_tests/CallCredentialsTest.php5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index 45aa8bfc6b..ee604a387c 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -191,8 +191,10 @@ function oauth2AuthToken($stub, $args)
'invalid email returned');
}
-function updateAuthMetadataCallback($authUri)
+function updateAuthMetadataCallback($context)
{
+ $authUri = $context->service_url;
+ $methodName = $context->method_name;
$auth_credentials = ApplicationDefaultCredentials::getCredentials();
return $auth_credentials->updateMetadata($metadata = [], $authUri);
diff --git a/src/php/tests/unit_tests/CallCredentialsTest.php b/src/php/tests/unit_tests/CallCredentialsTest.php
index aac21d4c49..0918412781 100644
--- a/src/php/tests/unit_tests/CallCredentialsTest.php
+++ b/src/php/tests/unit_tests/CallCredentialsTest.php
@@ -69,9 +69,10 @@ class CallCredentialsTest extends PHPUnit_Framework_TestCase
unset($this->server);
}
- public function callbackFunc($service_url)
+ public function callbackFunc($context)
{
- $this->assertTrue(is_string($service_url));
+ $this->assertTrue(is_string($context->service_url));
+ $this->assertTrue(is_string($context->method_name));
return ['k1' => ['v1'], 'k2' => ['v2']];
}