From d614274ed207b827cf4e580a9454bea45989a236 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 20 Jul 2014 22:58:24 +0200 Subject: [PATCH] Add a few SSH2 preLogin tests. --- tests/Functional/Net/SSH2Test.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/Functional/Net/SSH2Test.php b/tests/Functional/Net/SSH2Test.php index 22d97703..f07f27cf 100644 --- a/tests/Functional/Net/SSH2Test.php +++ b/tests/Functional/Net/SSH2Test.php @@ -32,6 +32,36 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase /** * @depends testConstructor + * @group github408 + * @group github412 + */ + public function testPreLogin($ssh) + { + $this->assertFalse( + $ssh->isConnected(), + 'Failed asserting that SSH2 is not connected after construction.' + ); + + $this->assertNotEmpty( + $ssh->getServerPublicHostKey(), + 'Failed asserting that a non-empty public host key was fetched.' + ); + + $this->assertTrue( + $ssh->isConnected(), + 'Failed asserting that SSH2 is connected after public key fetch.' + ); + + $this->assertNotEmpty( + $ssh->getServerIdentification(), + 'Failed asserting that the server identifier was set after connect.' + ); + + return $ssh; + } + + /** + * @depends testPreLogin */ public function testPasswordLogin($ssh) {