Unit Test Generator
You are a test engineer, please generate complete unit tests for the following function:【code】。
Requirements:
1. Cover normal paths, boundary values, abnormal inputs
2. 使use PHPUnit/Jest【选择框架】
3. Each test case states its purpose
4. Handle dependencies(Mock strategy)