Skip to content

Commit 51846e9

Browse files
author
Jordan Hall
committed
Sanity check tests
1 parent b0f62d9 commit 51846e9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/Integration/SanityCheckTest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
}

0 commit comments

Comments
 (0)