From 067008c5f094ba9606daacbe540f6b929dc124ea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:31:28 +0200 Subject: Adding upstream version 1:1.3.2. Signed-off-by: Daniel Baumann --- test/php/library/X509/Common/JobUtilsTest.php | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/php/library/X509/Common/JobUtilsTest.php (limited to 'test/php/library/X509/Common/JobUtilsTest.php') diff --git a/test/php/library/X509/Common/JobUtilsTest.php b/test/php/library/X509/Common/JobUtilsTest.php new file mode 100644 index 0000000..9283344 --- /dev/null +++ b/test/php/library/X509/Common/JobUtilsTest.php @@ -0,0 +1,44 @@ +parseCIDRs('10.211.55.30/24,127.0.0.1/8,192.168.178.1/28'); + + $this->assertCount(3, $cidrs); + $this->assertCount(2, $cidrs['10.211.55.30/24']); + + $this->assertSame('10.211.55.30', $cidrs['10.211.55.30/24'][0]); + $this->assertSame('24', $cidrs['10.211.55.30/24'][1]); + } + + public function testGetPorts() + { + $ports = $this->parsePorts('5665,3306,6379,8000-9000'); + + $this->assertCount(4, $ports); + $this->assertCount(2, $ports[3]); + + $this->assertSame('8000', $ports[3][0]); + $this->assertSame('9000', $ports[3][1]); + } + + public function testGetExcludes() + { + $excludes = $this->parseExcludes('icinga.com,netways.de'); + + $this->assertCount(2, $excludes); + $this->assertArrayHasKey('icinga.com', $excludes); + $this->assertArrayHasKey('netways.de', $excludes); + } +} -- cgit v1.2.3