File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace UniFi_API \Tests ;
44
5+ use UniFi_API \Client ;
56use PHPUnit \Framework \TestCase ;
67
78class ClientTest extends TestCase
89{
9- public function testSomething ()
10+ private $ client ;
11+
12+ protected function setUp ()
13+ {
14+ $ this ->client = new Client ('unifi ' , 'unifi ' );
15+ }
16+
17+ public function testSetSite ()
1018 {
19+ // default
20+ $ this ->assertEquals ('default ' , $ this ->client ->get_site ());
21+
22+ // custom
23+ $ this ->client ->set_site ('foobar ' );
24+ $ this ->assertEquals ('foobar ' , $ this ->client ->get_site ());
25+
26+ // whitespace
27+ $ this ->client ->set_site (' foobar ' );
28+ $ this ->assertEquals ('foobar ' , $ this ->client ->get_site ());
1129
30+ // whitespace (debug mode)
31+ $ this ->client ->set_debug (true );
32+ $ this ->expectException (\PHPUnit_Framework_Error_Notice::class);
33+ $ this ->expectExceptionCode (E_USER_NOTICE );
34+ $ this ->expectExceptionMessage ('The provided (short) site name may not contain any spaces ' );
35+ $ this ->client ->set_site (' foobar ' );
1236 }
1337}
You can’t perform that action at this time.
0 commit comments