PHP: Fix property reference in BaseStub::close()

pull/3858/head
Anthony Yeh 9 years ago
parent 2d12214dcc
commit 04e1eb8423
  1. 2
      src/php/lib/Grpc/BaseStub.php
  2. 2
      src/php/tests/generated_code/AbstractGeneratedCodeTest.php
  3. 6
      src/php/tests/generated_code/GeneratedCodeTest.php
  4. 6
      src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php

@ -123,7 +123,7 @@ class BaseStub {
* Close the communication channel associated with this stub * Close the communication channel associated with this stub
*/ */
public function close() { public function close() {
$channel->close(); $this->channel->close();
} }
/** /**

@ -32,7 +32,7 @@
* *
*/ */
require_once realpath(dirname(__FILE__) . '/../../vendor/autoload.php'); require_once realpath(dirname(__FILE__) . '/../../vendor/autoload.php');
require 'math.php'; require_once dirname(__FILE__) . '/math.php';
abstract class AbstractGeneratedCodeTest extends PHPUnit_Framework_TestCase { abstract class AbstractGeneratedCodeTest extends PHPUnit_Framework_TestCase {
/* These tests require that a server exporting the math service must be /* These tests require that a server exporting the math service must be
* running on $GRPC_TEST_HOST */ * running on $GRPC_TEST_HOST */

@ -31,11 +31,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
require 'AbstractGeneratedCodeTest.php'; require_once dirname(__FILE__) . '/AbstractGeneratedCodeTest.php';
class GeneratedCodeTest extends AbstractGeneratedCodeTest { class GeneratedCodeTest extends AbstractGeneratedCodeTest {
public static function setUpBeforeClass() { public static function setUpBeforeClass() {
self::$client = new math\MathClient( self::$client = new math\MathClient(
getenv('GRPC_TEST_HOST'), []); getenv('GRPC_TEST_HOST'), []);
} }
public static function tearDownAfterClass() {
self::$client->close();
}
} }

@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
require 'AbstractGeneratedCodeTest.php'; require_once dirname(__FILE__) . '/AbstractGeneratedCodeTest.php';
class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest { class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest {
public static function setUpBeforeClass() { public static function setUpBeforeClass() {
@ -44,4 +44,8 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest {
return $a_copy; return $a_copy;
}]); }]);
} }
public static function tearDownAfterClass() {
self::$client->close();
}
} }

Loading…
Cancel
Save