From 2205c4740bddea5c3cb6d8f0e44d6ae9b55ddd28 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 28 Dec 2023 10:31:07 +0000 Subject: [PATCH] * Test checkAddress. --- module/zahost/test/model/checkaddress.php | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 module/zahost/test/model/checkaddress.php diff --git a/module/zahost/test/model/checkaddress.php b/module/zahost/test/model/checkaddress.php new file mode 100755 index 0000000000..162915175b --- /dev/null +++ b/module/zahost/test/model/checkaddress.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +checkAddress(); +timeout=0 +cid=1 + +- 测试不是正常地址得到的结果 @0 +- 测试正常域名得到的结果 @1 +- 测试正常 IP 得到的结果 @1 + +*/ + +include dirname(__FILE__, 5) . '/test/lib/init.php'; +include dirname(__FILE__, 2) . '/zahost.class.php'; +su('admin'); + +$addressList = array('a', 'www.baidu.com', '10.0.1.222'); + +$zahost = new zahostTest(); +r($zahost->checkAddress($addressList[0])) && p('') && e('0'); //测试不是正常地址得到的结果 +r($zahost->checkAddress($addressList[1])) && p('') && e('1'); //测试正常域名得到的结果 +r($zahost->checkAddress($addressList[2])) && p('') && e('1'); //测试正常 IP 得到的结果 \ No newline at end of file