Skip to content

test(session): 补充 Redis Session Handler 单元测试 - #45

Merged
JanHuang merged 1 commit into
masterfrom
test/redis-session-handler
Oct 27, 2026
Merged

JanHuang merged 1 commit into
masterfrom
test/redis-session-handler

Conversation

@JanHuang

Copy link
Copy Markdown
Member

变更

补充 RedisSessionHandler 单元测试:

  • 非字符串 Redis 返回值(false/null/int)
  • JSON scalar(null/int/string/bool)降级为空数组
  • 自定义 prefix
  • Unicode 不转义
  • 最大数据长度边界
  • JSON 编码失败
  • setex 失败
  • destroy / exists 缺失
  • gc(maxLifetime) 仍为 no-op

验证

  • 目标测试:20 tests / 52 assertions ✅
  • 全量测试:777 tests / 2056 assertions ✅
  • PHPStan 2:No errors ✅

覆盖非字符串/非数组 JSON、Unicode、最大长度边界、
JSON 编码失败、setex 失败、destroy/exists 缺失以及 gc 参数。
@JanHuang
JanHuang merged commit c857d6d into master Oct 27, 2026
2 checks passed
@JanHuang
JanHuang deleted the test/redis-session-handler branch October 27, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant