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

39 lines
1.2 KiB
PHP
Executable file

#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
/**
title=测试 webhookModel->getDingdingData();
timeout=0
cid=19696
- 打印出msgtype第markdown条的title属性 @ceshi
- 测试不传text的情况第markdown条的title属性 @ceshi
- 测试不传mobile的情况
- 第markdown条的title属性 @ceshi
- 第markdown条的text属性 @文本信息
- 测试不传mobile的情况第markdown条的title属性 @~~
*/
$webhook = new webhookModelTest();
$title = array();
$title[0] = 'ceshi';
$title[1] = '';
$text = array();
$text[0] = '文本信息';
$text[1] = '';
$mobile = array();
$mobile[0] = '123456';
$mobile[1] = '';
r($webhook->getDingdingDataTest($title[0], $text[0], $mobile[0])) && p('markdown:title') && e('ceshi'); //打印出msgtype
r($webhook->getDingdingDataTest($title[0], $text[1], $mobile[0])) && p('markdown:title') && e('ceshi'); //测试不传text的情况
r($webhook->getDingdingDataTest($title[0], $text[0], $mobile[1])) && p('markdown:title,text') && e('ceshi,文本信息'); //测试不传mobile的情况
r($webhook->getDingdingDataTest($title[1], $text[0], $mobile[0])) && p('markdown:title') && e('~~'); //测试不传mobile的情况