mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-11-08 03:50:50 +08:00
chore(notice): 规范修复与安装演练收尾
This commit is contained in:
@@ -42,11 +42,11 @@ class NoticeServiceTest extends TestCase
|
||||
|
||||
$this->assertGreaterThan(0, $noticeId);
|
||||
$this->assertDatabaseHas('system_notice', [
|
||||
'id' => $noticeId,
|
||||
'scene' => 'common',
|
||||
'title' => '测试标题',
|
||||
'content' => '测试内容',
|
||||
'biz_id' => '',
|
||||
'id' => $noticeId,
|
||||
'scene' => 'common',
|
||||
'title' => '测试标题',
|
||||
'content' => '测试内容',
|
||||
'biz_id' => '',
|
||||
'send_admin_id' => 0,
|
||||
]);
|
||||
|
||||
@@ -130,11 +130,11 @@ class NoticeServiceTest extends TestCase
|
||||
$this->assertSame(2, Db::name('system_notice_target')
|
||||
->where('notice_id', $noticeId)->where('admin_id', $adminWithMail)->count());
|
||||
$this->assertDatabaseHas('system_notice_target', [
|
||||
'notice_id' => $noticeId,
|
||||
'admin_id' => $adminWithMail,
|
||||
'channel' => 'email',
|
||||
'notice_id' => $noticeId,
|
||||
'admin_id' => $adminWithMail,
|
||||
'channel' => 'email',
|
||||
'target_addr' => 'scene@test.com',
|
||||
'status' => 0,
|
||||
'status' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -220,8 +220,8 @@ class NoticeServiceTest extends TestCase
|
||||
$this->assertSame(1, Db::name('system_notice_target')->where('notice_id', $noticeId)->count());
|
||||
$this->assertDatabaseHas('system_notice_target', [
|
||||
'notice_id' => $noticeId,
|
||||
'channel' => 'inmail',
|
||||
'status' => 2,
|
||||
'channel' => 'inmail',
|
||||
'status' => 2,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -269,8 +269,8 @@ class NoticeServiceTest extends TestCase
|
||||
$noticeId2 = NoticeService::send([$adminId], '总闸恢复', '内容');
|
||||
$this->assertDatabaseHas('system_notice_target', [
|
||||
'notice_id' => $noticeId2,
|
||||
'channel' => 'inmail',
|
||||
'status' => 2,
|
||||
'channel' => 'inmail',
|
||||
'status' => 2,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -348,11 +348,11 @@ class NoticeServiceTest extends TestCase
|
||||
private function createAdmin(array $overrides = []): int
|
||||
{
|
||||
$data = array_merge([
|
||||
'username' => 'ntc_' . uniqid(),
|
||||
'password' => 'not-a-real-password',
|
||||
'nickname' => '通知测试用户',
|
||||
'email' => '',
|
||||
'status' => 1,
|
||||
'username' => 'ntc_' . uniqid(),
|
||||
'password' => 'not-a-real-password',
|
||||
'nickname' => '通知测试用户',
|
||||
'email' => '',
|
||||
'status' => 1,
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
'delete_time' => 0,
|
||||
@@ -367,10 +367,10 @@ class NoticeServiceTest extends TestCase
|
||||
private function insertSubscribe(int $adminId, string $scene, string $channel, int $status): void
|
||||
{
|
||||
Db::name('system_notice_subscribe')->insert([
|
||||
'admin_id' => $adminId,
|
||||
'scene' => $scene,
|
||||
'channel' => $channel,
|
||||
'status' => $status,
|
||||
'admin_id' => $adminId,
|
||||
'scene' => $scene,
|
||||
'channel' => $channel,
|
||||
'status' => $status,
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
@@ -385,11 +385,11 @@ class NoticeServiceTest extends TestCase
|
||||
private function setInmailSwitch(string $value): void
|
||||
{
|
||||
Db::name('system_config')->insert([
|
||||
'name' => 'notify_inmail_enable',
|
||||
'group' => 'notify',
|
||||
'value' => $value,
|
||||
'remark' => 'NoticeServiceTest fixture',
|
||||
'sort' => 100,
|
||||
'name' => 'notify_inmail_enable',
|
||||
'group' => 'notify',
|
||||
'value' => $value,
|
||||
'remark' => 'NoticeServiceTest fixture',
|
||||
'sort' => 100,
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user