From 4a8df3f7d84b01073e682c0627e93619950888a7 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 1 Oct 2016 19:02:07 +0200 Subject: [PATCH] Add some tests that would have discovered #1 --- ChangeLog.md | 4 ++++ .../nagios/unittest/NscaClientTest.class.php | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 9336ab0..59287d0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,10 @@ nsca ChangeLog ## ?.?.? / ????-??-?? +## 5.1.1 / 2016-10-01 + +* Fixed issue #1: Wrong constant name - @emil-nasso, @thekid + ## 5.1.0 / 2016-08-28 * Added forward compatibility with XP 8.0.0 - @thekid diff --git a/src/test/php/org/nagios/unittest/NscaClientTest.class.php b/src/test/php/org/nagios/unittest/NscaClientTest.class.php index c7bdf5e..bbd71de 100644 --- a/src/test/php/org/nagios/unittest/NscaClientTest.class.php +++ b/src/test/php/org/nagios/unittest/NscaClientTest.class.php @@ -9,6 +9,26 @@ */ class NscaClientTest extends \unittest\TestCase { + #[@test] + public function can_create_with_host() { + $client= new NscaClient('nagios.xp-framework.net'); + } + + #[@test] + public function can_create_with_host_and_port() { + $client= new NscaClient('nagios.xp-framework.net', 5667); + } + + #[@test] + public function can_create_with_host_port_and_version() { + $client= new NscaClient('nagios.xp-framework.net', 5667, NscaProtocol::VERSION_3); + } + + #[@test] + public function can_create_with_host_port_and_version_and_crypt() { + $client= new NscaClient('nagios.xp-framework.net', 5667, NscaProtocol::VERSION_3, NscaProtocol::CRYPT_XOR); + } + #[@test] public function encrypt() { $client= new NscaClient('nagios.xp-framework.net', 5667, NscaProtocol::VERSION_3, NscaProtocol::CRYPT_XOR);