message-notify/test/NotifyTest.php
2022-10-27 16:30:53 +08:00

33 lines
661 B
PHP

<?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);
}
}