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.
dev
1 parent cb12a87 commit 47ec5e79c1d43373f05cb059080ed804dd5427b7
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 3 hours ago
Showing 11 changed files
View
docs/server-audit.md
View
server/SHServ/App.php
View
server/SHServ/Models/Devices.php
View
server/SHServ/Tools/DeviceAPI/Base.php
View
server/tests/AppAuthGuardTest.php 0 → 100644
View
server/tests/AreasControllerHappyPathTest.php 0 → 100644
View
server/tests/DeviceAPIBaseRetryTest.php 0 → 100644
View
server/tests/DevicesModelTransactionTest.php 0 → 100644
View
server/tests/ScriptsModelStateTest.php 0 → 100644
View
server/tests/TestApp.php
View
server/tests/bootstrap.php