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 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
|
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);
}
|