diff options
author | Stanley Cheung <stanleycheung@google.com> | 2015-08-19 14:25:00 -0700 |
---|---|---|
committer | Stanley Cheung <stanleycheung@google.com> | 2015-08-19 14:25:00 -0700 |
commit | 478fb00a2cec11d7178ca6f1605f920e1c4142a1 (patch) | |
tree | 9844349603bfe03cd41b85e2765cf162ee26802e /src/php/tests | |
parent | 89bede02f16905eb48b71710dc4ea2542b3a5ca1 (diff) |
php: expose per-call host override option
Diffstat (limited to 'src/php/tests')
-rwxr-xr-x | src/php/tests/unit_tests/SecureEndToEndTest.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/php/tests/unit_tests/SecureEndToEndTest.php b/src/php/tests/unit_tests/SecureEndToEndTest.php index f91c006da5..60341b983d 100755 --- a/src/php/tests/unit_tests/SecureEndToEndTest.php +++ b/src/php/tests/unit_tests/SecureEndToEndTest.php @@ -40,13 +40,15 @@ class SecureEndToEndTest extends PHPUnit_Framework_TestCase{ file_get_contents(dirname(__FILE__) . '/../data/server1.key'), file_get_contents(dirname(__FILE__) . '/../data/server1.pem')); $this->server = new Grpc\Server(); - $port = $this->server->addSecureHttp2Port('0.0.0.0:0', + $this->port = $this->server->addSecureHttp2Port('0.0.0.0:0', $server_credentials); $this->server->start(); + $this->host_override = 'foo.test.google.fr'; $this->channel = new Grpc\Channel( - 'localhost:' . $port, + 'localhost:' . $this->port, [ - 'grpc.ssl_target_name_override' => 'foo.test.google.fr', + 'grpc.ssl_target_name_override' => $this->host_override, + 'grpc.default_authority' => $this->host_override, 'credentials' => $credentials ]); } @@ -61,7 +63,8 @@ class SecureEndToEndTest extends PHPUnit_Framework_TestCase{ $status_text = 'xyz'; $call = new Grpc\Call($this->channel, 'dummy_method', - $deadline); + $deadline, + $this->host_override); $event = $call->startBatch([ Grpc\OP_SEND_INITIAL_METADATA => [], @@ -112,7 +115,8 @@ class SecureEndToEndTest extends PHPUnit_Framework_TestCase{ $call = new Grpc\Call($this->channel, 'dummy_method', - $deadline); + $deadline, + $this->host_override); $event = $call->startBatch([ Grpc\OP_SEND_INITIAL_METADATA => [], |