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 5
5
6
6
final class SSHConnectionTest extends TestCase
7
7
{
8
- public function testSSHConnection ()
8
+ public function testSSHConnectionWithKeyPair ()
9
9
{
10
10
$ connection = (new SSHConnection ())
11
11
->to ('localhost ' )
@@ -22,4 +22,22 @@ public function testSSHConnection()
22
22
$ this ->assertEquals ('' , $ command ->getError ());
23
23
$ this ->assertEquals ('' , $ command ->getRawError ());
24
24
}
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
+ }
25
43
}
You can’t perform that action at this time.
0 commit comments