|
Add high-complexity PHPUnit tests: retry/backoff, auth guard, transactions, happy-paths, script state
- Refactor Base.php: extract executeCurl/getCurlInfo for mockability - Refactor App.php: split api_auth_guard into check_api_auth (testable) + guard wrapper - Refactor Devices.php: add optional ?Base DI to connect_new_device - Update TestApp.php: add control_scripts_instances for script tests - Update bootstrap.php: define PHPUNIT_TEST to skip new App() autoload side-effect New test files: - DeviceAPIBaseRetryTest (7 tests) — retry/backoff with mock cURL - AppAuthGuardTest (7 tests) — auth + rate limiter without exit - DevicesModelTransactionTest (4 tests) — happy path, rollback, mode checks - AreasControllerHappyPathTest (7 tests) — full area CRUD success flows - ScriptsModelStateTest (8 tests) — scope list, script state, enable/disable Total: 113 tests, 285 assertions — all passing. |
|---|
|
|
| docs/server-audit.md |
|---|
| server/SHServ/App.php |
|---|
| server/SHServ/Models/Devices.php |
|---|
| server/SHServ/Tools/DeviceAPI/Base.php |
|---|
| server/tests/AppAuthGuardTest.php 0 → 100644 |
|---|
| server/tests/AreasControllerHappyPathTest.php 0 → 100644 |
|---|
| server/tests/DeviceAPIBaseRetryTest.php 0 → 100644 |
|---|
| server/tests/DevicesModelTransactionTest.php 0 → 100644 |
|---|
| server/tests/ScriptsModelStateTest.php 0 → 100644 |
|---|
| server/tests/TestApp.php |
|---|
| server/tests/bootstrap.php |
|---|