File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ public static function getGithubKeys($username)
5252
5353 public static function testValidSSHKey ($ key_str )
5454 {
55+ // https://github.com/phpseclib/phpseclib/issues/2077
56+ // key loader still throws exception, this just mutes a warning for phpunit
57+ if (preg_match ("/^[0-9]+$/ " , $ key_str )) {
58+ return false ;
59+ }
60+ // https://github.com/phpseclib/phpseclib/issues/2076
61+ // key loader still throws exception, this just mutes a warning for phpunit
62+ if (!is_null (@json_decode ($ key_str ))) {
63+ return false ;
64+ }
5565 try {
5666 PublicKeyLoader::load ($ key_str );
5767 return true ;
Original file line number Diff line number Diff line change @@ -27,14 +27,6 @@ public static function SSHKeyProvider()
2727 public function testTestValidSSHKey (bool $ expected , string $ key )
2828 {
2929 $ SITE = new UnitySite ();
30- // https://github.com/phpseclib/phpseclib/issues/2077
31- if (preg_match ("/^[0-9]+$/ " , $ key )) {
32- $ this ->expectWarning ();
33- }
34- // https://github.com/phpseclib/phpseclib/issues/2076
35- if (!is_null (@json_decode ($ key ))) {
36- $ this ->expectWarning ();
37- }
3830 $ this ->assertEquals ($ expected , $ SITE ->testValidSSHKey ($ key ));
3931 }
4032
You can’t perform that action at this time.
0 commit comments