1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
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/SCPSSH2UserStoryTest.php | 2 +-
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/PhpseclibFunctionalTestCase.php | 2 +-
tests/PhpseclibTestCase.php | 12 ++++++------
tests/Unit/Crypt/AES/McryptTest.php | 2 +-
tests/Unit/Crypt/AES/OpenSSLTest.php | 2 +-
tests/Unit/Crypt/AES/PurePHPTest.php | 2 +-
tests/Unit/Crypt/Hash/TestCase.php | 4 ++--
tests/Unit/Math/BigInteger/BCMathTest.php | 2 +-
tests/Unit/Math/BigInteger/GMPTest.php | 2 +-
tests/Unit/Math/BigInteger/InternalOpenSSLTest.php | 2 +-
tests/Unit/Math/BigInteger/InternalTest.php | 2 +-
tests/Unit/Math/BigInteger/TestCase.php | 2 +-
17 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/tests/Functional/Net/SCPSSH2UserStoryTest.php b/tests/Functional/Net/SCPSSH2UserStoryTest.php
index 8040724..2456158 100644
--- a/tests/Functional/Net/SCPSSH2UserStoryTest.php
+++ b/tests/Functional/Net/SCPSSH2UserStoryTest.php
@@ -15,7 +15,7 @@ class Functional_Net_SCPSSH2UserStoryTest extends PhpseclibFunctionalTestCase
protected static $exampleData;
protected static $exampleDataLength;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$remoteFile = uniqid('phpseclib-scp-ssh2-') . '.txt';
diff --git a/tests/Functional/Net/SFTPLargeFileTest.php b/tests/Functional/Net/SFTPLargeFileTest.php
index 69baa8e..17e2978 100644
--- a/tests/Functional/Net/SFTPLargeFileTest.php
+++ b/tests/Functional/Net/SFTPLargeFileTest.php
@@ -11,7 +11,7 @@ use phpseclib\Net\SFTP;
class Functional_Net_SFTPLargeFileTest extends Functional_Net_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 2268989..439c84a 100644
--- a/tests/Functional/Net/SFTPStreamTest.php
+++ b/tests/Functional/Net/SFTPStreamTest.php
@@ -10,7 +10,7 @@ use phpseclib\Net\SFTP\Stream;
class Functional_Net_SFTPStreamTest extends Functional_Net_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 abd5999..dad3098 100644
--- a/tests/Functional/Net/SFTPTestCase.php
+++ b/tests/Functional/Net/SFTPTestCase.php
@@ -16,7 +16,7 @@ abstract class Functional_Net_SFTPTestCase extends PhpseclibFunctionalTestCase
protected $sftp;
protected $scratchDir;
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
$this->scratchDir = uniqid('phpseclib-sftp-scratch-');
@@ -30,7 +30,7 @@ abstract class Functional_Net_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 4157dcd..567d265 100644
--- a/tests/Functional/Net/SFTPUserStoryTest.php
+++ b/tests/Functional/Net/SFTPUserStoryTest.php
@@ -15,7 +15,7 @@ class Functional_Net_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 f9b03b4..67c1859 100644
--- a/tests/Functional/Net/SSH2AgentTest.php
+++ b/tests/Functional/Net/SSH2AgentTest.php
@@ -11,7 +11,7 @@ use phpseclib\System\SSH\Agent;
class Functional_Net_SSH2AgentTest extends PhpseclibFunctionalTestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (!isset($_SERVER['SSH_AUTH_SOCK'])) {
self::markTestSkipped(
diff --git a/tests/PhpseclibFunctionalTestCase.php b/tests/PhpseclibFunctionalTestCase.php
index e0b3a7c..93d7131 100644
--- a/tests/PhpseclibFunctionalTestCase.php
+++ b/tests/PhpseclibFunctionalTestCase.php
@@ -10,7 +10,7 @@ use phpseclib\Math\BigInteger;
abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (extension_loaded('runkit')) {
if (extension_loaded('gmp')) {
diff --git a/tests/PhpseclibTestCase.php b/tests/PhpseclibTestCase.php
index 547c5a6..7e112e4 100644
--- a/tests/PhpseclibTestCase.php
+++ b/tests/PhpseclibTestCase.php
@@ -9,7 +9,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
{
protected $tempFilesToUnlinkOnTearDown = array();
- public function tearDown()
+ public function tearDown(): void
{
foreach ($this->tempFilesToUnlinkOnTearDown as $filename) {
if (!file_exists($filename) || unlink($filename)) {
@@ -103,7 +103,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
}
// assertIsArray was not introduced until PHPUnit 8
- public static function assertIsArray($actual, $message = '')
+ public static function assertIsArray($actual, $message = ''): void
{
if (method_exists('\PHPUnit\Framework\TestCase', 'assertIsArray')) {
parent::assertIsArray($actual, $message);
@@ -114,7 +114,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
}
// assertIsString was not introduced until PHPUnit 8
- public static function assertIsString($actual, $message = '')
+ public static function assertIsString($actual, $message = ''): void
{
if (method_exists('\PHPUnit\Framework\TestCase', 'assertIsString')) {
parent::assertIsString($actual, $message);
@@ -125,7 +125,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
}
// assertContains is deprecated for strings in PHPUnit 8
- public static function assertStringContainsString($needle, $haystack, $message = '')
+ public static function assertStringContainsString($needle, $haystack, $message = ''): void
{
if (method_exists('\PHPUnit\Framework\TestCase', 'assertStringContainsString')) {
parent::assertStringContainsString($needle, $haystack, $message);
@@ -136,7 +136,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
}
// assertNotContains is deprecated for strings in PHPUnit 8
- public static function assertStringNotContainsString($needle, $haystack, $message = '')
+ public static function assertStringNotContainsString($needle, $haystack, $message = ''): void
{
if (method_exists('\PHPUnit\Framework\TestCase', 'assertStringContainsString')) {
parent::assertStringNotContainsString($needle, $haystack, $message);
@@ -146,7 +146,7 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
parent::assertNotContains($needle, $haystack, $message);
}
- public function setExpectedException($name, $message = null, $code = null)
+ public function setExpectedException($name, $message = null, $code = null): void
{
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
parent::setExpectedException($name, $message, $code);
diff --git a/tests/Unit/Crypt/AES/McryptTest.php b/tests/Unit/Crypt/AES/McryptTest.php
index ecd203c..887e48d 100644
--- a/tests/Unit/Crypt/AES/McryptTest.php
+++ b/tests/Unit/Crypt/AES/McryptTest.php
@@ -9,7 +9,7 @@ use phpseclib\Crypt\Base;
class Unit_Crypt_AES_McryptTest extends Unit_Crypt_AES_TestCase
{
- protected function setUp()
+ protected function setUp(): void
{
$this->engine = Base::ENGINE_MCRYPT;
}
diff --git a/tests/Unit/Crypt/AES/OpenSSLTest.php b/tests/Unit/Crypt/AES/OpenSSLTest.php
index 211a0ea..a7079f7 100644
--- a/tests/Unit/Crypt/AES/OpenSSLTest.php
+++ b/tests/Unit/Crypt/AES/OpenSSLTest.php
@@ -9,7 +9,7 @@ use phpseclib\Crypt\Base;
class Unit_Crypt_AES_OpenSSLTest extends Unit_Crypt_AES_TestCase
{
- protected function setUp()
+ protected function setUp(): void
{
$this->engine = Base::ENGINE_OPENSSL;
}
diff --git a/tests/Unit/Crypt/AES/PurePHPTest.php b/tests/Unit/Crypt/AES/PurePHPTest.php
index 8692ec6..e72534c 100644
--- a/tests/Unit/Crypt/AES/PurePHPTest.php
+++ b/tests/Unit/Crypt/AES/PurePHPTest.php
@@ -9,7 +9,7 @@ use phpseclib\Crypt\Base;
class Unit_Crypt_AES_PurePHPTest extends Unit_Crypt_AES_TestCase
{
- protected function setUp()
+ protected function setUp(): void
{
$this->engine = Base::ENGINE_INTERNAL;
}
diff --git a/tests/Unit/Crypt/Hash/TestCase.php b/tests/Unit/Crypt/Hash/TestCase.php
index 2ef63c6..256a84f 100644
--- a/tests/Unit/Crypt/Hash/TestCase.php
+++ b/tests/Unit/Crypt/Hash/TestCase.php
@@ -9,14 +9,14 @@ use phpseclib\Crypt\Hash;
abstract class Unit_Crypt_Hash_TestCase extends PhpseclibTestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (!defined('CRYPT_HASH_MODE')) {
define('CRYPT_HASH_MODE', Hash::MODE_INTERNAL);
}
}
- public function setUp()
+ public function setUp(): void
{
if (defined('CRYPT_HASH_MODE') && CRYPT_HASH_MODE !== Hash::MODE_INTERNAL) {
$this->markTestSkipped(
diff --git a/tests/Unit/Math/BigInteger/BCMathTest.php b/tests/Unit/Math/BigInteger/BCMathTest.php
index 691d403..c28e828 100644
--- a/tests/Unit/Math/BigInteger/BCMathTest.php
+++ b/tests/Unit/Math/BigInteger/BCMathTest.php
@@ -7,7 +7,7 @@
class Unit_Math_BigInteger_BCMathTest extends Unit_Math_BigInteger_TestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (!extension_loaded('bcmath')) {
self::markTestSkipped('BCMath extension is not available.');
diff --git a/tests/Unit/Math/BigInteger/GMPTest.php b/tests/Unit/Math/BigInteger/GMPTest.php
index f344a4e..6b84136 100644
--- a/tests/Unit/Math/BigInteger/GMPTest.php
+++ b/tests/Unit/Math/BigInteger/GMPTest.php
@@ -7,7 +7,7 @@
class Unit_Math_BigInteger_GMPTest extends Unit_Math_BigInteger_TestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (!extension_loaded('gmp')) {
self::markTestSkipped('GNU Multiple Precision (GMP) extension is not available.');
diff --git a/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php b/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php
index d5056b8..edc70dc 100644
--- a/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php
+++ b/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php
@@ -7,7 +7,7 @@
class Unit_Math_BigInteger_InternalOpenSSLTest extends Unit_Math_BigInteger_TestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
if (!extension_loaded('openssl')) {
self::markTestSkipped('openssl_public_encrypt() function is not available.');
diff --git a/tests/Unit/Math/BigInteger/InternalTest.php b/tests/Unit/Math/BigInteger/InternalTest.php
index 599d94a..1a0ccd2 100644
--- a/tests/Unit/Math/BigInteger/InternalTest.php
+++ b/tests/Unit/Math/BigInteger/InternalTest.php
@@ -7,7 +7,7 @@
class Unit_Math_BigInteger_InternalTest extends Unit_Math_BigInteger_TestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
diff --git a/tests/Unit/Math/BigInteger/TestCase.php b/tests/Unit/Math/BigInteger/TestCase.php
index e2f6dab..05b3f4a 100644
--- a/tests/Unit/Math/BigInteger/TestCase.php
+++ b/tests/Unit/Math/BigInteger/TestCase.php
@@ -7,7 +7,7 @@
abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
{
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::reRequireFile('Math/BigInteger.php');
|