Merge pull request #3017 from stanley-cheung/php_update_gen_code_test

PHP: update codegen, client now extends basestub
pull/3024/head
Michael Lumish 9 years ago
commit 0ea28f1ca5
  1. 8
      src/php/tests/generated_code/AbstractGeneratedCodeTest.php
  2. 4
      src/php/tests/generated_code/GeneratedCodeTest.php
  3. 4
      src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php

@ -39,6 +39,14 @@ abstract class AbstractGeneratedCodeTest extends PHPUnit_Framework_TestCase {
protected static $client;
protected static $timeout;
public function testWaitForNotReady() {
$this->assertFalse(self::$client->waitForReady(1));
}
public function testWaitForReady() {
$this->assertTrue(self::$client->waitForReady(250000));
}
public function testSimpleRequest() {
$div_arg = new math\DivArgs();
$div_arg->setDividend(7);

@ -35,7 +35,7 @@ require 'AbstractGeneratedCodeTest.php';
class GeneratedCodeTest extends AbstractGeneratedCodeTest {
public static function setUpBeforeClass() {
self::$client = new math\MathClient(new Grpc\BaseStub(
getenv('GRPC_TEST_HOST'), []));
self::$client = new math\MathClient(
getenv('GRPC_TEST_HOST'), []);
}
}

@ -35,13 +35,13 @@ require 'AbstractGeneratedCodeTest.php';
class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest {
public static function setUpBeforeClass() {
self::$client = new math\MathClient(new Grpc\BaseStub(
self::$client = new math\MathClient(
getenv('GRPC_TEST_HOST'), ['update_metadata' =>
function($a_hash,
$client = array()) {
$a_copy = $a_hash;
$a_copy['foo'] = ['bar'];
return $a_copy;
}]));
}]);
}
}

Loading…
Cancel
Save