message-notify/test/NotifyTest.php

33 lines
661 B
PHP
Raw Normal View History

2022-10-27 08:30:53 +00:00
<?php
declare(strict_types=1);
namespace TmWms\MessageNotifyTest;
use PHPUnit\Framework\TestCase;
use TmWms\MessageNotify\Channel\DingTalkChannel;
use TmWms\MessageNotify\Notify;
use TmWms\MessageNotify\Template\Text\DingTalk;
class NotifyTest extends TestCase
{
public function testCase()
{
// 初始通道
$channel = new DingTalkChannel();
// 初始消息模板
$template = (new DingTalk())
->setTitle('test')
->setText('test')
//@所有人
->setAt([
'all'
]);
// 发送
Notify::make($channel)->send($template);
}
}