Properties

$operator

$operator : \App\Models\SysUser

Type

SysUser

Methods

test_positions_required_in_login_request()

test_positions_required_in_login_request() : void

验证登录 Request 缺少 positions 校验失败。

test_positions_required_in_send_register_code_request()

test_positions_required_in_send_register_code_request() : void

验证发送注册码 Request 缺少 positions 校验失败。

test_positions_required_in_forgot_password_request()

test_positions_required_in_forgot_password_request() : void

验证找回密码 Request 缺少 positions 校验失败。

test_post_scope_empty_items_allowed_to_clear()

test_post_scope_empty_items_allowed_to_clear() : void

验证岗位范围覆盖式同步空数组通过(清空全部范围)。

test_post_scope_missing_items_still_rejected()

test_post_scope_missing_items_still_rejected() : void

验证岗位范围 items 键缺失仍拒绝。

test_import_csv_returns_created_skipped_passwords()

test_import_csv_returns_created_skipped_passwords() : void

验证导入 CSV 返回 created/skipped/passwords 三键。

test_force_destroy_deletes_recycle_file_with_physical_and_thumb()

test_force_destroy_deletes_recycle_file_with_physical_and_thumb() : void

验证彻底删除回收站文件(物理文件 + 缩略图 + 记录一并清理)。

test_force_destroy_rejects_normal_file()

test_force_destroy_rejects_normal_file() : void

验证正常状态文件拒绝彻底删除。

test_file_is_image_type_accepts_legacy_and_code_values()

test_file_is_image_type_accepts_legacy_and_code_values() : void

验证文件图片判定接受历史中文值与稳定码双值兼容。

test_d01_file_type_registry_uses_stable_codes()

test_d01_file_type_registry_uses_stable_codes() : void

验证文件分类注册表与模型常量同源(值即契约)。

test_definitions_include_public_and_dependency_fields()

test_definitions_include_public_and_dependency_fields() : void

验证配置定义列表返回 is_public/depends_on/depends_value/sub_group 四字段。

requestErrors()

requestErrors(\Illuminate\Foundation\Http\FormRequest  $request, string|null  $uri = null, string|null  $controller = null) : array<string,string[]>

独立校验 FormRequest 并返回错误集。

Parameters

\Illuminate\Foundation\Http\FormRequest $request
string|null $uri

路由模板(如 'templates/{id}');Request 的 withValidator 依赖 route 上下文时必传,否则可省略

string|null $controller

控制器@方法 串(路由绑定用,仅与 $uri 搭配)

Returns

array

校验错误集(通过时为空数组)

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

validationErrors()

validationErrors(mixed  $request) : array<string,string[]>

校验断言:FormRequest 校验失败时抛 ValidationException(Laravel 13 无 getValidatorInstance)。

Parameters

mixed $request

Returns

array

校验错误集(校验通过时返回 [])

makeFile()

makeFile(int  $status, string  $path = 'private/x/a.txt', ?string  $thumbPath = null) : \App\Models\SysFile

Parameters

int $status
string $path
?string $thumbPath

Returns

\App\Models\SysFile —