* Add regression tests for global admin privilege check in TOTP exceptions (#1012)
Verifies that global admins with both 'admin' and 'global-admin' roles
can add TOTP exceptions for any domain, while regular admins are
restricted to their managed domains.
* Add tests for db_in_clause(): placeholders, empty array, unique keys, real query
Covers the parameterized query refactor from PR #1004.
* Move test cleanup to tearDown: add admin table delete and session unset
Prevents state leaking between tests, especially when expectException()
aborts the method before inline cleanup runs.
* Use assertEquals with exact expected SQL per review