Skip to content

Commit

Permalink
Merge pull request grpc#3017 from stanley-cheung/php_update_gen_code_…
Browse files Browse the repository at this point in the history
…test

PHP: update codegen, client now extends basestub
  • Loading branch information
murgatroid99 committed Aug 21, 2015
2 parents a753ba1 + 4c0fcda commit 0ea28f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/php/tests/generated_code/AbstractGeneratedCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/php/tests/generated_code/GeneratedCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

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'), []);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@

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;
}]));
}]);
}
}

0 comments on commit 0ea28f1

Please sign in to comment.