diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 0a3e1f78bf4..d4fb3ba17e5 100755 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -123,7 +123,7 @@ class BaseStub { * Close the communication channel associated with this stub */ public function close() { - $channel->close(); + $this->channel->close(); } /** diff --git a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php index 5cdba1e5a0f..940635389b0 100644 --- a/src/php/tests/generated_code/AbstractGeneratedCodeTest.php +++ b/src/php/tests/generated_code/AbstractGeneratedCodeTest.php @@ -32,7 +32,7 @@ * */ require_once realpath(dirname(__FILE__) . '/../../vendor/autoload.php'); -require 'math.php'; +require_once dirname(__FILE__) . '/math.php'; abstract class AbstractGeneratedCodeTest extends PHPUnit_Framework_TestCase { /* These tests require that a server exporting the math service must be * running on $GRPC_TEST_HOST */ diff --git a/src/php/tests/generated_code/GeneratedCodeTest.php b/src/php/tests/generated_code/GeneratedCodeTest.php index a1a2ce81dbf..e5600dc6a51 100755 --- a/src/php/tests/generated_code/GeneratedCodeTest.php +++ b/src/php/tests/generated_code/GeneratedCodeTest.php @@ -31,11 +31,15 @@ * 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 { public static function setUpBeforeClass() { self::$client = new math\MathClient( getenv('GRPC_TEST_HOST'), []); } + + public static function tearDownAfterClass() { + self::$client->close(); + } } diff --git a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php index 68f57d34ad7..902eeb41e6c 100644 --- a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php +++ b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php @@ -31,7 +31,7 @@ * 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 { public static function setUpBeforeClass() { @@ -44,4 +44,8 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest { return $a_copy; }]); } + + public static function tearDownAfterClass() { + self::$client->close(); + } }