+ Move unit test from test directory to each module.

This commit is contained in:
zhouxin
2023-04-24 02:16:47 +00:00
parent 8b32e6592a
commit 4efea42989
1671 changed files with 83077 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 2) . '/webhook.class.php';
su('admin');
/**
title=测试 webhookModel->getBoundUsers();
cid=1
pid=1
统计匹配数量 >> 1
取出其中一个用户 >> 2
传入不存在的情况 >> 0
传入空时 >> 0
*/
$webhook = new webhookTest();
$ID = array();
$ID[0] = 1;
$ID[1] = 1111;
$ID[2] = '';
$user = array();
$user[0] = array('user3', 'user4');
$user[1] = 'user3, user1111';
$user[2] = '';
r(count($webhook->getBoundUsersTest($ID[0], $user[0]))) && p() && e('1'); //统计匹配数量
r($webhook->getBoundUsersTest($ID[0], $user[0])) && p('user4') && e('2'); //取出其中一个用户
r(count($webhook->getBoundUsersTest($ID[1], $user[1]))) && p() && e('0'); //传入不存在的情况
r(count($webhook->getBoundUsersTest($ID[2], $user[2]))) && p() && e('0'); //传入空时