\Tests\FeatureConfigMultiselectBoundTest

测试基座(抽象基类)

被测对象:无(公共测试设施) 守护约定:Redis 直连用例在无 Redis 环境(如 CI)跳过而非失败(TEST_REQUIRE_REDIS=1 可强制失败); 缓存注册表最小 schema 供 sqlite :memory: 下凡走注册表的用例自建。

Summary

Methods
Properties
Constants
test_set_comma_string_roundtrip()
test_set_array_dedupes_and_normalizes()
test_rejects_value_outside_registry()
test_empty_string_means_select_none()
test_auto_shared_scenes_whitelist_is_file_scene_registry()
test_group_emits_dynamic_options_for_multiselect()
test_inline_preview_whitelist_excludes_executable_types()
No public properties found
No constants found
makeDef()
requireRedis()
buildCacheRegistry()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

test_set_comma_string_roundtrip()

test_set_comma_string_roundtrip() : void

验证逗号串写入回读。

test_set_array_dedupes_and_normalizes()

test_set_array_dedupes_and_normalizes() : void

验证数组写入去重并归一化为逗号串。

test_rejects_value_outside_registry()

test_rejects_value_outside_registry() : void

验证注册表外选项被拒绝。

test_empty_string_means_select_none()

test_empty_string_means_select_none() : void

验证空串表示清空选择。

test_auto_shared_scenes_whitelist_is_file_scene_registry()

test_auto_shared_scenes_whitelist_is_file_scene_registry() : void

验证 auto_shared_scenes 白名单即 FileScene 注册表(注册表外场景拒绝)。

test_group_emits_dynamic_options_for_multiselect()

test_group_emits_dynamic_options_for_multiselect() : void

验证 group 为 multiselect 下发注册表对象选项(value=稳定码、label=中文映射)。

test_inline_preview_whitelist_excludes_executable_types()

test_inline_preview_whitelist_excludes_executable_types() : void

验证内联预览白名单不含 html/svg/xml 等可内联执行类。

makeDef()

makeDef(string  $key, string  $type, mixed  $default = null, string  $validation = '', string  $options = '', int  $isTabs) : \App\Models\SysConfigDefinition

创建测试配置定义(TEST 组,静态来源)

Parameters

string $key
string $type
mixed $default
string $validation
string $options
int $isTabs

Returns

\App\Models\SysConfigDefinition —

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