File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 55
66final class SSHConnectionTest extends TestCase
77{
8- public function testSSHConnection ()
8+ public function testSSHConnectionWithKeyPair ()
99 {
1010 $ connection = (new SSHConnection ())
1111 ->to ('localhost ' )
@@ -22,4 +22,22 @@ public function testSSHConnection()
2222 $ this ->assertEquals ('' , $ command ->getError ());
2323 $ this ->assertEquals ('' , $ command ->getRawError ());
2424 }
25+
26+ public function testSSHConnectionWithPassword ()
27+ {
28+ $ connection = (new SSHConnection ())
29+ ->to ('localhost ' )
30+ ->onPort (22 )
31+ ->as ('travis ' )
32+ ->withPassword ('test.rebex.net ' )
33+ ->connect ();
34+
35+ $ command = $ connection ->run ('echo "Hello world!" ' );
36+
37+ $ this ->assertEquals ('Hello world! ' , $ command ->getOutput ());
38+ $ this ->assertEquals ('Hello world! ' ."\n" , $ command ->getRawOutput ());
39+
40+ $ this ->assertEquals ('' , $ command ->getError ());
41+ $ this ->assertEquals ('' , $ command ->getRawError ());
42+ }
2543}
You can’t perform that action at this time.
0 commit comments