Properties

$userA

$userA : \App\Models\SysUser

Type

SysUser

$userB

$userB : \App\Models\SysUser

Type

SysUser

$dept

$dept : \App\Models\SysDept

Type

SysDept

$role

$role : \App\Models\SysRole

Type

SysRole

Methods

test_store_creates_draft_then_publish_expands_and_counts()

test_store_creates_draft_then_publish_expands_and_counts() : void

test_category_blank_normalizes_to_null()

test_category_blank_normalizes_to_null() : void

test_unread_count_and_read_flow()

test_unread_count_and_read_flow() : void

test_read_all_marks_visible_messages()

test_read_all_marks_visible_messages() : void

test_need_read_zero_excluded_from_unread()

test_need_read_zero_excluded_from_unread() : void

test_visibility_user_target()

test_visibility_user_target() : void

test_visibility_dept_and_role_target()

test_visibility_dept_and_role_target() : void

test_dept_publish_expands_descendants()

test_dept_publish_expands_descendants() : void

test_revoke_hides_from_user_side()

test_revoke_hides_from_user_side() : void

test_expired_message_invisible()

test_expired_message_invisible() : void

test_destroy_cascades_read_rows_and_guards_published()

test_destroy_cascades_read_rows_and_guards_published() : void

test_destroy_after_revoke_cascades_read_rows()

test_destroy_after_revoke_cascades_read_rows() : void

test_send_system_message_dedup_by_biz_key()

test_send_system_message_dedup_by_biz_key() : void

test_my_paginate_splits_tabs_and_orders_unread_first()

test_my_paginate_splits_tabs_and_orders_unread_first() : void

test_message_notify_event_persists_via_listener()

test_message_notify_event_persists_via_listener() : void

事件链路:MessageNotifyEvent 派发 → WriteMessageNotify 监听落库(无感于触发方)

test_message_notify_event_carries_need_read()

test_message_notify_event_carries_need_read() : void

事件内容:needRead 由触发方表达,监听器原样落库(0=仅展示,不参与未读)

requireRedis()

requireRedis() : void

Redis 依赖探针:直连 Redis 的测试(限流/会话/验证码)在无 Redis 环境(如 CI) 跳过而非失败——其余用例不受影响。CI 可设 TEST_REQUIRE_REDIS=1 强制模式: Redis 不可达即失败而非跳过,安全回归套件不允许静默消失。

buildCacheRegistry()

buildCacheRegistry(array  $items) : void

建缓存注册表最小 schema(td_sys_cache)并灌入注册项。

测试跑 sqlite :memory:,生产迁移含 PostgreSQL 专属 DDL 跑不通(DataScopeServiceTest 同因自建 schema); 而 CacheManager::registry() 现已从数据库表读取——凡走注册表的测试(remember/get/key/失效推导) 必须在 setUp 先调用本方法,否则注册表为空、remember 未登记名会走「自动登记」路径。

Parameters

array $items

setUp()

setUp() : void

buildSchema()

buildSchema() : void

最小 schema:消息/已读/用户/任职/角色绑定(create_time 靠 DB 默认值,模型不写)

seedData()

seedData() : void

publishAnnouncement()

publishAnnouncement(array  $overrides = []) : \App\Models\SysMessage

发布一条公告并返回模型

Parameters

array $overrides

Returns

\App\Models\SysMessage —