dwoodauto-ding-notice/tests/Feature/LinkTest.php

49 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2023-04-12 15:05:18 +08:00
<?php
namespace DingNotice\Tests\Feature;
use DingNotice\Tests\TestCase;
class LinkTest extends TestCase
{
protected $title = "自定义机器人协议";
protected $text = "群机器人是钉钉群的高级扩展功能。群机器人可以将第三方服务的信息聚合到群聊中实现自动化的信息同步。例如通过聚合GitHubGitLab等源码管理服务实现源码更新同步通过聚合TrelloJIRA等项目协调服务实现项目信息同步。不仅如此群机器人支持Webhook协议的自定义接入支持更多可能性例如你可将运维报警提醒通过自定义机器人聚合到钉钉群。";
protected $picUrl = "";
protected $messageUrl = "https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.Rqyvqo&treeId=257&articleId=105735&docType=1";
public function __construct($name = null, array $data = [], $dataName = '')
{
parent::__construct($name, $data, $dataName);
$this->setUp();
}
/**
* available content to set
* @param $content
* @return bool
* @author wangju 2019-05-17 21:50
*/
protected function matchContent($content)
{
return $content['text'] && $content['title'] && $content['messageUrl'];
}
/**
* A basic test example.
*
* @return void
*/
public function testPushLinkMessage()
{
$result = $this->ding->link($this->title,$this->text,$this->messageUrl,$this->picUrl);
$this->assertSame([
'errmsg' => 'ok',
'errcode' => 0
],$result);
}
}