to fit phpunit8 grammar, add void to setUpBeforeClass(), setUp() and tearDown()

pull/24695/head
root 4 years ago
parent e989bb8b83
commit 4429620608
  1. 4
      src/php/tests/generated_code/GeneratedCodeTest.php
  2. 4
      src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php
  3. 4
      src/php/tests/unit_tests/CallCredentials2Test.php
  4. 4
      src/php/tests/unit_tests/CallCredentialsTest.php
  5. 4
      src/php/tests/unit_tests/CallInvokerTest.php
  6. 6
      src/php/tests/unit_tests/CallTest.php
  7. 4
      src/php/tests/unit_tests/ChannelCredentialsTest.php
  8. 4
      src/php/tests/unit_tests/ChannelTest.php
  9. 4
      src/php/tests/unit_tests/EndToEndTest.php
  10. 4
      src/php/tests/unit_tests/InterceptorTest.php
  11. 4
      src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php
  12. 4
      src/php/tests/unit_tests/SecureEndToEndTest.php
  13. 4
      src/php/tests/unit_tests/ServerTest.php
  14. 4
      src/php/tests/unit_tests/TimevalTest.php

@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php';
class GeneratedCodeTest extends AbstractGeneratedCodeTest class GeneratedCodeTest extends AbstractGeneratedCodeTest
{ {
public function setUp() public function setUp(): void
{ {
self::$client = new Math\MathClient( self::$client = new Math\MathClient(
getenv('GRPC_TEST_HOST'), [ getenv('GRPC_TEST_HOST'), [
@ -28,7 +28,7 @@ class GeneratedCodeTest extends AbstractGeneratedCodeTest
]); ]);
} }
public function tearDown() public function tearDown(): void
{ {
self::$client->close(); self::$client->close();
} }

@ -20,7 +20,7 @@ require_once dirname(__FILE__).'/AbstractGeneratedCodeTest.php';
class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest
{ {
public function setUp() public function setUp(): void
{ {
self::$client = new Math\MathClient( self::$client = new Math\MathClient(
getenv('GRPC_TEST_HOST'), getenv('GRPC_TEST_HOST'),
@ -35,7 +35,7 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest
]); ]);
} }
public function tearDown() public function tearDown(): void
{ {
self::$client->close(); self::$client->close();
} }

@ -19,7 +19,7 @@
class CallCredentials2Test extends \PHPUnit\Framework\TestCase class CallCredentials2Test extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$credentials = Grpc\ChannelCredentials::createSsl( $credentials = Grpc\ChannelCredentials::createSsl(
file_get_contents(dirname(__FILE__).'/../data/ca.pem')); 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->channel);
unset($this->server); unset($this->server);

@ -19,7 +19,7 @@
class CallCredentialsTest extends \PHPUnit\Framework\TestCase class CallCredentialsTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$this->credentials = Grpc\ChannelCredentials::createSsl( $this->credentials = Grpc\ChannelCredentials::createSsl(
file_get_contents(dirname(__FILE__).'/../data/ca.pem')); 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->channel);
unset($this->server); unset($this->server);

@ -161,14 +161,14 @@ class CallInvokerChangeRequestCall
class CallInvokerTest extends \PHPUnit\Framework\TestCase class CallInvokerTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$this->server = new Grpc\Server([]); $this->server = new Grpc\Server([]);
$this->port = $this->server->addHttp2Port('0.0.0.0:0'); $this->port = $this->server->addHttp2Port('0.0.0.0:0');
$this->server->start(); $this->server->start();
} }
public function tearDown() public function tearDown(): void
{ {
unset($this->server); unset($this->server);
} }

@ -21,14 +21,14 @@ class CallTest extends \PHPUnit\Framework\TestCase
public static $server; public static $server;
public static $port; public static $port;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$server = new Grpc\Server([]); self::$server = new Grpc\Server([]);
self::$port = self::$server->addHttp2Port('0.0.0.0:53000'); self::$port = self::$server->addHttp2Port('0.0.0.0:53000');
self::$server->start(); self::$server->start();
} }
public function setUp() public function setUp(): void
{ {
$this->channel = new Grpc\Channel('localhost:'.self::$port, [ $this->channel = new Grpc\Channel('localhost:'.self::$port, [
'force_new' => true, 'force_new' => true,
@ -38,7 +38,7 @@ class CallTest extends \PHPUnit\Framework\TestCase
Grpc\Timeval::infFuture()); Grpc\Timeval::infFuture());
} }
public function tearDown() public function tearDown(): void
{ {
$this->channel->close(); $this->channel->close();
} }

@ -19,11 +19,11 @@
class ChanellCredentialsTest extends \PHPUnit\Framework\TestCase class ChanellCredentialsTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
} }
public function tearDown() public function tearDown(): void
{ {
} }

@ -19,11 +19,11 @@
class ChannelTest extends \PHPUnit\Framework\TestCase class ChannelTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
} }
public function tearDown() public function tearDown(): void
{ {
if (!empty($this->channel)) { if (!empty($this->channel)) {
$this->channel->close(); $this->channel->close();

@ -18,7 +18,7 @@
*/ */
class EndToEndTest extends \PHPUnit\Framework\TestCase class EndToEndTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$this->server = new Grpc\Server([]); $this->server = new Grpc\Server([]);
$this->port = $this->server->addHttp2Port('0.0.0.0:0'); $this->port = $this->server->addHttp2Port('0.0.0.0:0');
@ -28,7 +28,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->server->start(); $this->server->start();
} }
public function tearDown() public function tearDown(): void
{ {
$this->channel->close(); $this->channel->close();
unset($this->server); unset($this->server);

@ -217,7 +217,7 @@ class StopCallInterceptor extends Grpc\Interceptor
class InterceptorTest extends \PHPUnit\Framework\TestCase class InterceptorTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$this->server = new Grpc\Server([]); $this->server = new Grpc\Server([]);
$this->port = $this->server->addHttp2Port('0.0.0.0:0'); $this->port = $this->server->addHttp2Port('0.0.0.0:0');
@ -227,7 +227,7 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$this->server->start(); $this->server->start();
} }
public function tearDown() public function tearDown(): void
{ {
$this->channel->close(); $this->channel->close();
unset($this->server); unset($this->server);

@ -22,11 +22,11 @@
*/ */
class PersistentListTest extends \PHPUnit\Framework\TestCase class PersistentListTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
} }
public function tearDown() public function tearDown(): void
{ {
$channel_clean_persistent = $channel_clean_persistent =
new Grpc\Channel('localhost:50010', []); new Grpc\Channel('localhost:50010', []);

@ -18,7 +18,7 @@
*/ */
class SecureEndToEndTest extends \PHPUnit\Framework\TestCase class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$credentials = Grpc\ChannelCredentials::createSsl( $credentials = Grpc\ChannelCredentials::createSsl(
file_get_contents(dirname(__FILE__).'/../data/ca.pem')); 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(); $this->channel->close();
unset($this->server); unset($this->server);

@ -19,12 +19,12 @@
class ServerTest extends \PHPUnit\Framework\TestCase class ServerTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
$this->server = null; $this->server = null;
} }
public function tearDown() public function tearDown(): void
{ {
unset($this->server); unset($this->server);
} }

@ -18,11 +18,11 @@
*/ */
class TimevalTest extends \PHPUnit\Framework\TestCase class TimevalTest extends \PHPUnit\Framework\TestCase
{ {
public function setUp() public function setUp(): void
{ {
} }
public function tearDown() public function tearDown(): void
{ {
unset($this->time); unset($this->time);
} }

Loading…
Cancel
Save