消息组件初始版本

This commit is contained in:
ykxiao
2024-01-31 09:30:04 +08:00
commit 62cfeb1772
22 changed files with 1019 additions and 0 deletions

41
test/NotifyTest.php Normal file
View 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);
}
}