znt/module/webhook/test/model/fetchhook.php

27 lines
1.3 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 webhookModel::fetchHook();
timeout=0
cid=19688
- 步骤1测试钉钉用户webhook类型无绑定用户 @Could not resolve host
- 步骤2测试微信用户webhook类型无绑定用户 @false
- 步骤3测试飞书用户webhook类型无绑定用户 @false
- 步骤4测试普通webhook无效URL情况 @false
- 步骤5测试钉钉群组webhook正常情况 @{"errcode":0,"errmsg":"ok"}
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$webhookTest = new webhookModelTest();
r($webhookTest->fetchHookTestError('invalid_url', 'test')) && p() && e('Could not resolve host'); // 步骤1测试钉钉用户webhook类型无绑定用户
r($webhookTest->fetchHookTestMock('dinguser', 'test')) && p() && e('false'); // 步骤2测试微信用户webhook类型无绑定用户
r($webhookTest->fetchHookTestMock('wechatuser', 'test')) && p() && e('false'); // 步骤3测试飞书用户webhook类型无绑定用户
r($webhookTest->fetchHookTestMock('feishuuser', 'test')) && p() && e('false'); // 步骤4测试普通webhook无效URL情况
r($webhookTest->fetchHookTestMock('success', 'test')) && p() && e('{"errcode":0,"errmsg":"ok"}'); // 步骤5测试钉钉群组webhook正常情况