test(astrolabe): add unit tests for background token refresh

- Fix McpTokenStorageTest: add IDBConnection mock for new constructor parameter
- Add doctrine/dbal dev dependency for IQueryBuilder mock support
- Add tests for getAllUsersWithTokens() database query method
- Create RefreshUserTokensTest with comprehensive coverage:
  - Job interval configuration (15 min)
  - Token refresh threshold logic (50% lifetime)
  - issued_at tracking for accurate lifetime calculation
  - Fallback to default lifetime when issued_at missing
  - Token rotation handling
  - Error handling and logging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-01-27 12:23:06 +01:00
co-authored by Claude Opus 4.5
parent c46f9eb212
commit 815a09be34
4 changed files with 818 additions and 8 deletions
+1
View File
@@ -39,6 +39,7 @@
"php": "^8.1"
},
"require-dev": {
"doctrine/dbal": "^3.8",
"nextcloud/ocp": "dev-stable30",
"phpunit/phpunit": "^10.0",
"roave/security-advisories": "dev-latest"