消息组件初始版本
This commit is contained in:
41
test/NotifyTest.php
Normal file
41
test/NotifyTest.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MessageNotifyTest;
|
||||
|
||||
use MessageNotify\Channel\DingTalkChannel;
|
||||
use MessageNotify\Channel\FeiShuChannel;
|
||||
use MessageNotify\Channel\WechatChannel;
|
||||
use MessageNotify\Contracts\MessageNotifyInterface;
|
||||
use MessageNotify\Notify;
|
||||
use MessageNotify\Template\Markdown;
|
||||
use MessageNotify\Template\Text;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class NotifyTest extends TestCase
|
||||
{
|
||||
public function testCase()
|
||||
{
|
||||
$dingTalkChannel = new DingTalkChannel();
|
||||
$feiShuChannel = new FeiShuChannel();
|
||||
$wechatChannel = new WechatChannel();
|
||||
|
||||
$markdown = new Markdown();
|
||||
$text = new Text();
|
||||
|
||||
$notify = Notify::make()->setChannel(DingTalkChannel::class)
|
||||
->setAt(['all'])
|
||||
->setTitle('标题')
|
||||
->setText('测试')
|
||||
->setPipeline(MessageNotifyInterface::INFO)
|
||||
->setTemplate(Markdown::class)
|
||||
->send();
|
||||
|
||||
$this->assertEquals($notify, true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user