File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use DivineOmega \SSHConnection \SSHConnection ;
4+ use PHPUnit \Framework \TestCase ;
5+
6+ final class SSHConnectionTest extends TestCase
7+ {
8+ public function testNoHostname ()
9+ {
10+ $ this ->expectException (InvalidArgumentException::class);
11+
12+ (new SSHConnection ())
13+ ->onPort (22 )
14+ ->as ('travis ' )
15+ ->withKeyPair ('/home/travis/.ssh/id_rsa.pub ' , '/home/travis/.ssh/id_rsa ' )
16+ ->connect ();
17+ }
18+
19+ public function testNoUsername ()
20+ {
21+ $ this ->expectException (InvalidArgumentException::class);
22+
23+ (new SSHConnection ())
24+ ->to ('localhost ' )
25+ ->onPort (22 )
26+ ->withKeyPair ('/home/travis/.ssh/id_rsa.pub ' , '/home/travis/.ssh/id_rsa ' )
27+ ->connect ();
28+ }
29+
30+ public function testNoAuthentication ()
31+ {
32+ $ this ->expectException (InvalidArgumentException::class);
33+
34+ (new SSHConnection ())
35+ ->to ('localhost ' )
36+ ->onPort (22 )
37+ ->as ('travis ' )
38+ ->connect ();
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments