Skip to content

Commit b0f62d9

Browse files
author
Jordan Hall
committed
Test with password
1 parent b3b98cd commit b0f62d9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/Integration/SSHConnectionTest.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
final 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
}

0 commit comments

Comments
 (0)