| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare(strict_types=1);
- namespace SixShop\Message\Hook;
- use PHPUnit\Framework\TestCase;
- use think\Event;
- class SendNotificationsHookTest extends TestCase
- {
- protected SendNotificationsHook $sendNotifications;
- protected Event $event;
- protected function setUp(): void
- {
- $this->event = app()->get('event');
- $this->sendNotifications = app(SendNotificationsHook::class);
- }
- public function testHandle(): void
- {
- $this->event->trigger('message.send_notifications', [
- [
- 'user_id' => 1,
- 'title' => 'test',
- 'content' => 'test',
- 'type' => 2,
- ], [
- 'user_id' => 1,
- 'title' => 'test',
- 'content' => 'test',
- 'type' => 1,
- ],
- [
- 'user_id' => 1,
- 'title' => 'test',
- 'content' => 'test',
- 'type' => 5,
- ]
- ]);
- }
- }
|