33 lines
661 B
PHP
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);
|
|
|
|
}
|
|
}
|