From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Mon, 12 Aug 2019 07:30:13 -1000
Subject: Compatibility with recent PHPUnit (8)

---
 tests/Functional/Net/SFTPLargeFileTest.php      |  2 +-
 tests/Functional/Net/SFTPStreamTest.php         |  2 +-
 tests/Functional/Net/SFTPTestCase.php           |  4 ++--
 tests/Functional/Net/SFTPUserStoryTest.php      |  2 +-
 tests/Functional/Net/SSH2AgentTest.php          |  2 +-
 tests/PhpseclibTestCase.php                     | 16 ++++++++--------
 tests/Unit/Crypt/AES/EvalTest.php               |  2 +-
 tests/Unit/Crypt/AES/McryptTest.php             |  2 +-
 tests/Unit/Crypt/AES/OpenSSLTest.php            |  2 +-
 tests/Unit/Crypt/AES/PurePHPTest.php            |  2 +-
 tests/Unit/Crypt/RSA/LoadKeyTest.php            |  2 +-
 tests/Unit/Math/BigInteger/BCMathTest.php       |  2 +-
 tests/Unit/Math/BigInteger/GMPTest.php          |  2 +-
 tests/Unit/Math/BigInteger/PHP32Test.php        |  2 +-
 tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php |  2 +-
 tests/Unit/Math/BigInteger/PHP64Test.php        |  2 +-
 tests/Unit/Math/PrimeField/BCMathTest.php       |  4 ++--
 tests/Unit/Math/PrimeField/GMPTest.php          |  4 ++--
 tests/Unit/Math/PrimeField/PHP32Test.php        |  4 ++--
 tests/Unit/Math/PrimeField/PHP64Test.php        |  4 ++--
 20 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/tests/Functional/Net/SFTPLargeFileTest.php b/tests/Functional/Net/SFTPLargeFileTest.php
index f99bb3a..be905db 100644
--- a/tests/Functional/Net/SFTPLargeFileTest.php
+++ b/tests/Functional/Net/SFTPLargeFileTest.php
@@ -12,7 +12,7 @@ use phpseclib3\Net\SFTP;
 
 class SFTPLargeFileTest extends SFTPTestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!extension_loaded('mcrypt') && !extension_loaded('openssl')) {
             self::markTestSkipped('This test depends on mcrypt or openssl for performance.');
diff --git a/tests/Functional/Net/SFTPStreamTest.php b/tests/Functional/Net/SFTPStreamTest.php
index c8a5c1a..8a4daf0 100644
--- a/tests/Functional/Net/SFTPStreamTest.php
+++ b/tests/Functional/Net/SFTPStreamTest.php
@@ -12,7 +12,7 @@ use phpseclib3\Net\SFTP\Stream;
 
 class SFTPStreamTest extends SFTPTestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         Stream::register();
         parent::setUpBeforeClass();
diff --git a/tests/Functional/Net/SFTPTestCase.php b/tests/Functional/Net/SFTPTestCase.php
index 3ee9d48..1242ffc 100644
--- a/tests/Functional/Net/SFTPTestCase.php
+++ b/tests/Functional/Net/SFTPTestCase.php
@@ -22,7 +22,7 @@ abstract class SFTPTestCase extends PhpseclibFunctionalTestCase
     protected $sftp;
     protected $scratchDir;
 
-    public function setUp()
+    public function setUp(): void
     {
         parent::setUp();
         $this->scratchDir = uniqid('phpseclib-sftp-scratch-');
@@ -36,7 +36,7 @@ abstract class SFTPTestCase extends PhpseclibFunctionalTestCase
         $this->assertTrue($this->sftp->chdir($this->scratchDir));
     }
 
-    public function tearDown()
+    public function tearDown(): void
     {
         if ($this->sftp) {
             $this->sftp->chdir($this->getEnv('SSH_HOME'));
diff --git a/tests/Functional/Net/SFTPUserStoryTest.php b/tests/Functional/Net/SFTPUserStoryTest.php
index 863b889..650209c 100644
--- a/tests/Functional/Net/SFTPUserStoryTest.php
+++ b/tests/Functional/Net/SFTPUserStoryTest.php
@@ -18,7 +18,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     protected static $exampleDataLength;
     protected static $buffer;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         parent::setUpBeforeClass();
 
diff --git a/tests/Functional/Net/SSH2AgentTest.php b/tests/Functional/Net/SSH2AgentTest.php
index ee2d0d3..badaa62 100644
--- a/tests/Functional/Net/SSH2AgentTest.php
+++ b/tests/Functional/Net/SSH2AgentTest.php
@@ -14,7 +14,7 @@ use phpseclib3\Tests\PhpseclibFunctionalTestCase;
 
 class SSH2AgentTest extends PhpseclibFunctionalTestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!isset($_SERVER['SSH_AUTH_SOCK'])) {
             self::markTestSkipped(
diff --git a/tests/PhpseclibTestCase.php b/tests/PhpseclibTestCase.php
index 6d71096..f1739ba 100644
--- a/tests/PhpseclibTestCase.php
+++ b/tests/PhpseclibTestCase.php
@@ -14,7 +14,7 @@ abstract class PhpseclibTestCase extends TestCase
 {
     protected $tempFilesToUnlinkOnTearDown = [];
 
-    public function tearDown()
+    public function tearDown(): void
     {
         foreach ($this->tempFilesToUnlinkOnTearDown as $filename) {
             if (!file_exists($filename) || unlink($filename)) {
@@ -133,37 +133,37 @@ abstract class PhpseclibTestCase extends TestCase
     }
 
     // assertIsArray was not introduced until PHPUnit 8
-    public static function assertIsArray($actual, $message = '')
+    public static function assertIsArray($actual, $message = ''): void
     {
         parent::assertInternalType('array', $actual, $message);
     }
 
     // assertIsString was not introduced until PHPUnit 8
-    public static function assertIsString($actual, $message = '')
+    public static function assertIsString($actual, $message = ''): void
     {
         parent::assertInternalType('string', $actual, $message);
     }
 
     // assertIsResource was not introduced until PHPUnit 8
-    public static function assertIsResource($actual, $message = '')
+    public static function assertIsResource($actual, $message = ''): void
     {
         parent::assertInternalType('resource', $actual, $message);
     }
 
     // assertIsObject was not introduced until PHPUnit 8
-    public static function assertIsObject($actual, $message = '')
+    public static function assertIsObject($actual, $message = ''): void
     {
         parent::assertInternalType('object', $actual, $message);
     }
 
     // assertContains is deprecated for strings in PHPUnit 8
-    public static function assertStringContainsString($needle, $haystack, $message = '')
+    public static function assertStringContainsString($needle, $haystack, $message = ''): void
     {
         parent::assertContains($needle, $haystack, $message);
     }
 
     // assertNotContains is deprecated for strings in PHPUnit 8
-    public static function assertStringNotContainsString($needle, $haystack, $message = '')
+    public static function assertStringNotContainsString($needle, $haystack, $message = ''): void
     {
         parent::assertNotContains($needle, $haystack, $message);
     }
@@ -176,7 +176,7 @@ abstract class PhpseclibTestCase extends TestCase
      * @param string $message
      * @return void
      */
-    public static function assertMatchesRegularExpression($pattern, $string, $message = '')
+    public static function assertMatchesRegularExpression($pattern, $string, $message = ''): void
     {
         parent::assertRegExp($pattern, $string, $message);
     }
diff --git a/tests/Unit/Crypt/AES/EvalTest.php b/tests/Unit/Crypt/AES/EvalTest.php
index cbde295..4ec190a 100644
--- a/tests/Unit/Crypt/AES/EvalTest.php
+++ b/tests/Unit/Crypt/AES/EvalTest.php
@@ -10,7 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt\AES;
 
 class EvalTest extends TestCase
 {
-    protected function setUp()
+    protected function setUp(): void
     {
         $this->engine = 'Eval';
     }
diff --git a/tests/Unit/Crypt/AES/McryptTest.php b/tests/Unit/Crypt/AES/McryptTest.php
index a1a0b8b..76565a6 100644
--- a/tests/Unit/Crypt/AES/McryptTest.php
+++ b/tests/Unit/Crypt/AES/McryptTest.php
@@ -10,7 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt\AES;
 
 class McryptTest extends TestCase
 {
-    protected function setUp()
+    protected function setUp(): void
     {
         $this->engine = 'mcrypt';
     }
diff --git a/tests/Unit/Crypt/AES/OpenSSLTest.php b/tests/Unit/Crypt/AES/OpenSSLTest.php
index 5fef17e..40b19ac 100644
--- a/tests/Unit/Crypt/AES/OpenSSLTest.php
+++ b/tests/Unit/Crypt/AES/OpenSSLTest.php
@@ -10,7 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt\AES;
 
 class OpenSSLTest extends TestCase
 {
-    protected function setUp()
+    protected function setUp(): void
     {
         $this->engine = 'OpenSSL';
     }
diff --git a/tests/Unit/Crypt/AES/PurePHPTest.php b/tests/Unit/Crypt/AES/PurePHPTest.php
index ede8a9b..2d198ad 100644
--- a/tests/Unit/Crypt/AES/PurePHPTest.php
+++ b/tests/Unit/Crypt/AES/PurePHPTest.php
@@ -10,7 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt\AES;
 
 class PurePHPTest extends TestCase
 {
-    protected function setUp()
+    protected function setUp(): void
     {
         $this->engine = 'PHP';
     }
diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php
index aeb5395..5c0d654 100644
--- a/tests/Unit/Crypt/RSA/LoadKeyTest.php
+++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php
@@ -26,7 +26,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
 
 class LoadKeyTest extends PhpseclibTestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         PuTTY::setComment('phpseclib-generated-key');
         OpenSSH::setComment('phpseclib-generated-key');
diff --git a/tests/Unit/Math/BigInteger/BCMathTest.php b/tests/Unit/Math/BigInteger/BCMathTest.php
index ff0ce1a..b18d346 100644
--- a/tests/Unit/Math/BigInteger/BCMathTest.php
+++ b/tests/Unit/Math/BigInteger/BCMathTest.php
@@ -12,7 +12,7 @@ use phpseclib3\Math\BigInteger\Engines\BCMath;
 
 class BCMathTest extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!BCMath::isValidEngine()) {
             self::markTestSkipped('BCMath extension is not available.');
diff --git a/tests/Unit/Math/BigInteger/GMPTest.php b/tests/Unit/Math/BigInteger/GMPTest.php
index 4a2eda1..f69e7a0 100644
--- a/tests/Unit/Math/BigInteger/GMPTest.php
+++ b/tests/Unit/Math/BigInteger/GMPTest.php
@@ -12,7 +12,7 @@ use phpseclib3\Math\BigInteger\Engines\GMP;
 
 class GMPTest extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!GMP::isValidEngine()) {
             self::markTestSkipped('GNU Multiple Precision (GMP) extension is not available.');
diff --git a/tests/Unit/Math/BigInteger/PHP32Test.php b/tests/Unit/Math/BigInteger/PHP32Test.php
index 5319bc9..cff538c 100644
--- a/tests/Unit/Math/BigInteger/PHP32Test.php
+++ b/tests/Unit/Math/BigInteger/PHP32Test.php
@@ -12,7 +12,7 @@ use phpseclib3\Math\BigInteger\Engines\PHP32;
 
 class PHP32Test extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (version_compare(PHP_VERSION, '7.0.0') < 0) {
             self::markTestSkipped('32-bit integers slow things down too much on PHP 5.6');
diff --git a/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php b/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php
index ba59519..fae3766 100644
--- a/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php
+++ b/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php
@@ -13,7 +13,7 @@ use phpseclib3\Math\BigInteger\Engines\PHP64;
 
 class PHP64OpenSSLTest extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!PHP64::isValidEngine()) {
             self::markTestSkipped('64-bit integers are not available.');
diff --git a/tests/Unit/Math/BigInteger/PHP64Test.php b/tests/Unit/Math/BigInteger/PHP64Test.php
index 95165e6..547a411 100644
--- a/tests/Unit/Math/BigInteger/PHP64Test.php
+++ b/tests/Unit/Math/BigInteger/PHP64Test.php
@@ -12,7 +12,7 @@ use phpseclib3\Math\BigInteger\Engines\PHP64;
 
 class PHP64Test extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!PHP64::isValidEngine()) {
             self::markTestSkipped('64-bit integers are not available.');
diff --git a/tests/Unit/Math/PrimeField/BCMathTest.php b/tests/Unit/Math/PrimeField/BCMathTest.php
index b413aed..970d702 100644
--- a/tests/Unit/Math/PrimeField/BCMathTest.php
+++ b/tests/Unit/Math/PrimeField/BCMathTest.php
@@ -15,7 +15,7 @@ class BCMathTest extends TestCase
 {
     private static $defaultEngine;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!BCMath::isValidEngine()) {
             self::markTestSkipped('BCMath extension is not available.');
@@ -24,7 +24,7 @@ class BCMathTest extends TestCase
         BigInteger::setEngine('BCMath');
     }
 
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         BigInteger::setEngine(self::$defaultEngine);
     }
diff --git a/tests/Unit/Math/PrimeField/GMPTest.php b/tests/Unit/Math/PrimeField/GMPTest.php
index d16647b..72819a4 100644
--- a/tests/Unit/Math/PrimeField/GMPTest.php
+++ b/tests/Unit/Math/PrimeField/GMPTest.php
@@ -15,7 +15,7 @@ class GMPTest extends TestCase
 {
     private static $defaultEngine;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!GMP::isValidEngine()) {
             self::markTestSkipped('GMP extension is not available.');
@@ -24,7 +24,7 @@ class GMPTest extends TestCase
         BigInteger::setEngine('GMP');
     }
 
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         BigInteger::setEngine(self::$defaultEngine);
     }
diff --git a/tests/Unit/Math/PrimeField/PHP32Test.php b/tests/Unit/Math/PrimeField/PHP32Test.php
index 412b902..2589a84 100644
--- a/tests/Unit/Math/PrimeField/PHP32Test.php
+++ b/tests/Unit/Math/PrimeField/PHP32Test.php
@@ -15,7 +15,7 @@ class PHP32Test extends TestCase
 {
     private static $defaultEngine;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!PHP32::isValidEngine()) {
             self::markTestSkipped('PHP32 extension is not available.');
@@ -24,7 +24,7 @@ class PHP32Test extends TestCase
         BigInteger::setEngine('PHP32');
     }
 
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         BigInteger::setEngine(self::$defaultEngine);
     }
diff --git a/tests/Unit/Math/PrimeField/PHP64Test.php b/tests/Unit/Math/PrimeField/PHP64Test.php
index 0b45332..07f5615 100644
--- a/tests/Unit/Math/PrimeField/PHP64Test.php
+++ b/tests/Unit/Math/PrimeField/PHP64Test.php
@@ -15,7 +15,7 @@ class PHP64Test extends TestCase
 {
     private static $defaultEngine;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         if (!PHP64::isValidEngine()) {
             self::markTestSkipped('PHP64 engine is not available.');
@@ -24,7 +24,7 @@ class PHP64Test extends TestCase
         BigInteger::setEngine('PHP64');
     }
 
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         BigInteger::setEngine(self::$defaultEngine);
     }
