test_upsert_creates_then_updates_same_value()
test_upsert_creates_then_updates_same_value() : void
验证 upsert 同 value 先新增后覆盖(同 id 不新增行)。
字典便捷操作四件套
被测对象:DataDictService(upsertItem/updateItem/deleteItem/getItem) 守护约定:业务代码按 (type_code, value) 定位字典项增删改查、不关心 id; 停用项不污染消费端缓存、层级字典按 parent_value 定位父级。
buildCacheRegistry(array $items) : void
建缓存注册表最小 schema(td_sys_cache)并灌入注册项。
测试跑 sqlite :memory:,生产迁移含 PostgreSQL 专属 DDL 跑不通(DataScopeServiceTest 同因自建 schema); 而 CacheManager::registry() 现已从数据库表读取——凡走注册表的测试(remember/get/key/失效推导) 必须在 setUp 先调用本方法,否则注册表为空、remember 未登记名会走「自动登记」路径。
| array | $items |