From f31da26f58bc3a5c28c7da653c3d00864b648340 Mon Sep 17 00:00:00 2001 From: Matthieu Racine Date: Sun, 3 Mar 2019 15:21:22 +0100 Subject: [PATCH] Added phpunit tests --- tests/ClientTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ClientTest.php b/tests/ClientTest.php index cc6a7c2..a899a5d 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -82,6 +82,25 @@ class ClientTest extends TestCase } } + /** + * Test non legacy connection on legacy router (pre 6.43) + * + * login() method recognise legacy router response and swap to legacy mode + */ + public function test__constructLegacy2() + { + try { + $config = new Config(); + $config->set('user', 'admin')->set('pass', 'admin') + ->set('host', '127.0.0.1')->set('port', 18728)->set('legacy', false); + $obj = new Client($config); + $this->assertInternalType('object', $obj); + } catch (\Exception $e) { + $this->assertContains('Must be initialized ', $e->getMessage()); + } + } + + public function test__constructWrongPass() { $this->expectException(ClientException::class);