From 4429620608b0ca63124264382a2c0cd533969f66 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Nov 2020 19:43:15 +0000 Subject: [PATCH] to fit phpunit8 grammar, add void to setUpBeforeClass(), setUp() and tearDown() --- src/php/tests/generated_code/GeneratedCodeTest.php | 4 ++-- .../tests/generated_code/GeneratedCodeWithCallbackTest.php | 4 ++-- src/php/tests/unit_tests/CallCredentials2Test.php | 4 ++-- src/php/tests/unit_tests/CallCredentialsTest.php | 4 ++-- src/php/tests/unit_tests/CallInvokerTest.php | 4 ++-- src/php/tests/unit_tests/CallTest.php | 6 +++--- src/php/tests/unit_tests/ChannelCredentialsTest.php | 4 ++-- src/php/tests/unit_tests/ChannelTest.php | 4 ++-- src/php/tests/unit_tests/EndToEndTest.php | 4 ++-- src/php/tests/unit_tests/InterceptorTest.php | 4 ++-- .../PersistentChannelTests/PersistentChannelTest.php | 4 ++-- src/php/tests/unit_tests/SecureEndToEndTest.php | 4 ++-- src/php/tests/unit_tests/ServerTest.php | 4 ++-- src/php/tests/unit_tests/TimevalTest.php | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/php/tests/generated_code/GeneratedCodeTest.php b/src/php/tests/generated_code/GeneratedCodeTest.php index 91339d390ed..f9fa573bf3e 100755 --- a/src/php/tests/generated_code/GeneratedCodeTest.php +++ b/src/php/tests/generated_code/GeneratedCodeTest.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php'; class GeneratedCodeTest extends AbstractGeneratedCodeTest { - public function setUp() + public function setUp(): void { self::$client = new Math\MathClient( getenv('GRPC_TEST_HOST'), [ @@ -28,7 +28,7 @@ class GeneratedCodeTest extends AbstractGeneratedCodeTest ]); } - public function tearDown() + public function tearDown(): void { self::$client->close(); } diff --git a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php index 60a90fa025e..fb55d1659cd 100644 --- a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php +++ b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php'; class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest { - public function setUp() + public function setUp(): void { self::$client = new Math\MathClient( getenv('GRPC_TEST_HOST'), @@ -35,7 +35,7 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest ]); } - public function tearDown() + public function tearDown(): void { self::$client->close(); } diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php index e293fe266fc..35cf821645c 100644 --- a/src/php/tests/unit_tests/CallCredentials2Test.php +++ b/src/php/tests/unit_tests/CallCredentials2Test.php @@ -19,7 +19,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -43,7 +43,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { unset($this->channel); unset($this->server); diff --git a/src/php/tests/unit_tests/CallCredentialsTest.php b/src/php/tests/unit_tests/CallCredentialsTest.php index e3f3966268a..a88a2680dbb 100644 --- a/src/php/tests/unit_tests/CallCredentialsTest.php +++ b/src/php/tests/unit_tests/CallCredentialsTest.php @@ -19,7 +19,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -49,7 +49,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { unset($this->channel); unset($this->server); diff --git a/src/php/tests/unit_tests/CallInvokerTest.php b/src/php/tests/unit_tests/CallInvokerTest.php index d38feb9d975..300d805cb04 100644 --- a/src/php/tests/unit_tests/CallInvokerTest.php +++ b/src/php/tests/unit_tests/CallInvokerTest.php @@ -161,14 +161,14 @@ class CallInvokerChangeRequestCall class CallInvokerTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); $this->server->start(); } - public function tearDown() + public function tearDown(): void { unset($this->server); } diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php index 602369512ae..4d1be1b1e24 100644 --- a/src/php/tests/unit_tests/CallTest.php +++ b/src/php/tests/unit_tests/CallTest.php @@ -21,14 +21,14 @@ class CallTest extends \PHPUnit\Framework\TestCase public static $server; public static $port; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$server = new Grpc\Server([]); self::$port = self::$server->addHttp2Port('0.0.0.0:53000'); self::$server->start(); } - public function setUp() + public function setUp(): void { $this->channel = new Grpc\Channel('localhost:'.self::$port, [ 'force_new' => true, @@ -38,7 +38,7 @@ class CallTest extends \PHPUnit\Framework\TestCase Grpc\Timeval::infFuture()); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); } diff --git a/src/php/tests/unit_tests/ChannelCredentialsTest.php b/src/php/tests/unit_tests/ChannelCredentialsTest.php index 932fb1d0813..73963cee155 100644 --- a/src/php/tests/unit_tests/ChannelCredentialsTest.php +++ b/src/php/tests/unit_tests/ChannelCredentialsTest.php @@ -19,11 +19,11 @@ class ChanellCredentialsTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { } diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php index 714b693d890..8ae394511e8 100644 --- a/src/php/tests/unit_tests/ChannelTest.php +++ b/src/php/tests/unit_tests/ChannelTest.php @@ -19,11 +19,11 @@ class ChannelTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { if (!empty($this->channel)) { $this->channel->close(); diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php index 701f92321bc..08b28e02b81 100644 --- a/src/php/tests/unit_tests/EndToEndTest.php +++ b/src/php/tests/unit_tests/EndToEndTest.php @@ -18,7 +18,7 @@ */ class EndToEndTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); @@ -28,7 +28,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase $this->server->start(); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/InterceptorTest.php b/src/php/tests/unit_tests/InterceptorTest.php index 1ab4e2c8146..5e87679a3a2 100644 --- a/src/php/tests/unit_tests/InterceptorTest.php +++ b/src/php/tests/unit_tests/InterceptorTest.php @@ -217,7 +217,7 @@ class StopCallInterceptor extends Grpc\Interceptor class InterceptorTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = new Grpc\Server([]); $this->port = $this->server->addHttp2Port('0.0.0.0:0'); @@ -227,7 +227,7 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase $this->server->start(); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php index 860fc865261..f10daeb93fb 100644 --- a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php +++ b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php @@ -22,11 +22,11 @@ */ class PersistentListTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { $channel_clean_persistent = new Grpc\Channel('localhost:50010', []); diff --git a/src/php/tests/unit_tests/SecureEndToEndTest.php b/src/php/tests/unit_tests/SecureEndToEndTest.php index 23ab04c62c4..da9d9d07fac 100644 --- a/src/php/tests/unit_tests/SecureEndToEndTest.php +++ b/src/php/tests/unit_tests/SecureEndToEndTest.php @@ -18,7 +18,7 @@ */ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $credentials = Grpc\ChannelCredentials::createSsl( file_get_contents(dirname(__FILE__).'/../data/ca.pem')); @@ -42,7 +42,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase ); } - public function tearDown() + public function tearDown(): void { $this->channel->close(); unset($this->server); diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php index 6597853184a..b29a6b0eac3 100644 --- a/src/php/tests/unit_tests/ServerTest.php +++ b/src/php/tests/unit_tests/ServerTest.php @@ -19,12 +19,12 @@ class ServerTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { $this->server = null; } - public function tearDown() + public function tearDown(): void { unset($this->server); } diff --git a/src/php/tests/unit_tests/TimevalTest.php b/src/php/tests/unit_tests/TimevalTest.php index b5f372d6933..1a525088b2d 100644 --- a/src/php/tests/unit_tests/TimevalTest.php +++ b/src/php/tests/unit_tests/TimevalTest.php @@ -18,11 +18,11 @@ */ class TimevalTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { } - public function tearDown() + public function tearDown(): void { unset($this->time); }