diff --git a/tests/Unit/Crypt/DSA/LoadDSAKeyTest.php b/tests/Unit/Crypt/DSA/LoadDSAKeyTest.php index 0c681658..d04112b6 100644 --- a/tests/Unit/Crypt/DSA/LoadDSAKeyTest.php +++ b/tests/Unit/Crypt/DSA/LoadDSAKeyTest.php @@ -259,4 +259,19 @@ dlN48qLbSmUgsO7gq/1vodebMSHcduV4JTq8ix5Ey87QAAABQhHEzWiduF4V0DestSnJ3q class LoadDSAKeyTest extends Unit_Crypt_DSA_LoadDSAKeyTest { + /** + * @expectedException \phpseclib3\Exception\NoKeyLoadedException + */ + public function testBadKey() + { + parent::testBadKey(); + } + + /** + * @expectedException \phpseclib3\Exception\NoKeyLoadedException + */ + public function testPuTTYBadMAC() + { + parent::testPuTTYBadMac(); + } } diff --git a/tests/Unit/Crypt/HashTest.php b/tests/Unit/Crypt/HashTest.php index 0ef81c92..204169b5 100644 --- a/tests/Unit/Crypt/HashTest.php +++ b/tests/Unit/Crypt/HashTest.php @@ -468,4 +468,19 @@ class Unit_Crypt_HashTest extends PhpseclibTestCase class HashTest extends Unit_Crypt_HashTest { + /** + * @expectedException \phpseclib3\Exception\UnsupportedAlgorithmException + */ + public function testConstructorArgumentInvalid() + { + parent::testConstructorArgumentInvalid(); + } + + /** + * @expectedException \phpseclib3\Exception\UnsupportedAlgorithmException + */ + public function testSetHashInvalid() + { + parent::testSetHashInvalid(); + } } diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php index c773d581..1788513a 100644 --- a/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -1049,4 +1049,19 @@ n9dyFZYXxil/cgFG/PDMnuXy1Wcl8hb8iwQag4Y7ohiLXVTJa/0BAgMBAAE= class LoadKeyTest extends Unit_Crypt_RSA_LoadKeyTest { + /** + * @expectedException \phpseclib3\Exception\NoKeyLoadedException + */ + public function testBadKey() + { + parent::testBadKey(); + } + + /** + * @expectedException \phpseclib3\Exception\UnsupportedFormatException + */ + public function testSavePasswordXML() + { + parent::testSavePasswordXML(); + } } diff --git a/tests/Unit/Crypt/RSA/ModeTest.php b/tests/Unit/Crypt/RSA/ModeTest.php index b252f799..972892b1 100644 --- a/tests/Unit/Crypt/RSA/ModeTest.php +++ b/tests/Unit/Crypt/RSA/ModeTest.php @@ -187,4 +187,11 @@ HERE; class ModeTest extends Unit_Crypt_RSA_ModeTest { + /** + * @expectedException \LengthException + */ + public function testSmallModulo() + { + parent::testSmallModulo(); + } } diff --git a/tests/Unit/Net/SSH2UnitTest.php b/tests/Unit/Net/SSH2UnitTest.php index ad599106..2d2db708 100644 --- a/tests/Unit/Net/SSH2UnitTest.php +++ b/tests/Unit/Net/SSH2UnitTest.php @@ -42,7 +42,7 @@ class Unit_Net_SSH2UnitTest extends PhpseclibTestCase $this->assertStringStartsWith('SSH-2.0-phpseclib_3.0', $identifier); if (function_exists('sodium_crypto_sign_keypair')) { - $this->assertContains('libsodium', $identifier); + $this->assertStringContainsString('libsodium', $identifier); } if (extension_loaded('openssl')) { diff --git a/travis/run-phpunit.sh b/travis/run-phpunit.sh index 7e79c46e..3e49318b 100755 --- a/travis/run-phpunit.sh +++ b/travis/run-phpunit.sh @@ -25,6 +25,7 @@ then find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n setUpBeforeClass()/n setUpBeforeClass(): void/g' find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n setUp()/n setUp(): void/g' find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n tearDown()/n tearDown(): void/g' + find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/n assertSame()/n assertSame(): void/g' find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertIsArray([^)]*)\)/\1: void/g' find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertIsString([^)]*)\)/\1: void/g' find tests -type f -name "*.php" -print0 | xargs -0 sed -i 's/\(n assertIsResource([^)]*)\)/\1: void/g'